Skip to content

Commit 340c847

Browse files
format again
1 parent a5aa73a commit 340c847

17 files changed

Lines changed: 417 additions & 343 deletions

CommonExtendedObjectsTests/ImmutableLookupMapAllTests.cs

Lines changed: 22 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,32 +22,32 @@ namespace CommonExtendedObjectsTests
2222
public class ImmutableLookupMapAllTests
2323
{
2424
/// <summary>
25-
/// The string map data
25+
/// The float map data
2626
/// </summary>
27-
private Dictionary<int, string> _stringMapData;
27+
private Dictionary<int, float> _floatMapData;
2828

2929
/// <summary>
30-
/// The float map data
30+
/// The read only map
3131
/// </summary>
32-
private Dictionary<int, float> _floatMapData;
32+
private ReadOnlyDictionary<int, string> _readOnlyMap;
3333

3434
/// <summary>
35-
/// The string map
35+
/// The string map
3636
/// </summary>
3737
private ImmutableLookupMap<int, string> _stringMap;
3838

3939
/// <summary>
40-
/// The read only map
40+
/// The string map data
4141
/// </summary>
42-
private ReadOnlyDictionary<int, string> _readOnlyMap;
42+
private Dictionary<int, string> _stringMapData;
4343

4444
/// <summary>
45-
/// The unmanaged map
45+
/// The unmanaged map
4646
/// </summary>
4747
private ImmutableLookupMapUnmanaged<int, float> _unmanagedMap;
4848

4949
/// <summary>
50-
/// Setups this instance.
50+
/// Setups this instance.
5151
/// </summary>
5252
[TestInitialize]
5353
public void Setup()
@@ -67,7 +67,7 @@ public void Setup()
6767
}
6868

6969
/// <summary>
70-
/// Cleanups this instance.
70+
/// Cleanups this instance.
7171
/// </summary>
7272
[TestCleanup]
7373
public void Cleanup()
@@ -78,7 +78,7 @@ public void Cleanup()
7878
// ------------ STRING MAP TESTS ----------------
7979

8080
/// <summary>
81-
/// Tests the string map initialization.
81+
/// Tests the string map initialization.
8282
/// </summary>
8383
[TestMethod]
8484
public void TestStringMapInitialization()
@@ -91,7 +91,7 @@ public void TestStringMapInitialization()
9191
}
9292

9393
/// <summary>
94-
/// Tests the read only dictionary initialization.
94+
/// Tests the read only dictionary initialization.
9595
/// </summary>
9696
[TestMethod]
9797
public void TestReadOnlyDictionaryInitialization()
@@ -104,7 +104,7 @@ public void TestReadOnlyDictionaryInitialization()
104104
}
105105

106106
/// <summary>
107-
/// Tests the string map lookup.
107+
/// Tests the string map lookup.
108108
/// </summary>
109109
[TestMethod]
110110
public void TestStringMapLookup()
@@ -122,7 +122,7 @@ public void TestStringMapLookup()
122122
}
123123

124124
/// <summary>
125-
/// Tests the read only dictionary lookup.
125+
/// Tests the read only dictionary lookup.
126126
/// </summary>
127127
[TestMethod]
128128
public void TestReadOnlyDictionaryLookup()
@@ -142,7 +142,7 @@ public void TestReadOnlyDictionaryLookup()
142142
// ------------ UNMANAGED MAP TESTS ----------------
143143

144144
/// <summary>
145-
/// Tests the unmanaged map initialization.
145+
/// Tests the unmanaged map initialization.
146146
/// </summary>
147147
[TestMethod]
148148
public void TestUnmanagedMapInitialization()
@@ -155,7 +155,7 @@ public void TestUnmanagedMapInitialization()
155155
}
156156

157157
/// <summary>
158-
/// Tests the unmanaged map lookup.
158+
/// Tests the unmanaged map lookup.
159159
/// </summary>
160160
[TestMethod]
161161
public void TestUnmanagedMapLookup()
@@ -173,7 +173,7 @@ public void TestUnmanagedMapLookup()
173173
}
174174

175175
/// <summary>
176-
/// Tests the unmanaged map try get value.
176+
/// Tests the unmanaged map try get value.
177177
/// </summary>
178178
[TestMethod]
179179
public void TestUnmanagedMapTryGetValue()
@@ -185,7 +185,7 @@ public void TestUnmanagedMapTryGetValue()
185185
}
186186

187187
/// <summary>
188-
/// Tests the unmanaged map enumeration.
188+
/// Tests the unmanaged map enumeration.
189189
/// </summary>
190190
[TestMethod]
191191
public void TestUnmanagedMapEnumeration()
@@ -202,7 +202,7 @@ public void TestUnmanagedMapEnumeration()
202202
}
203203

204204
/// <summary>
205-
/// Tests the initialization and lookup performance comparison.
205+
/// Tests the initialization and lookup performance comparison.
206206
/// </summary>
207207
[TestMethod]
208208
public void TestInitializationAndLookupPerformanceComparison()
@@ -238,6 +238,7 @@ public void TestInitializationAndLookupPerformanceComparison()
238238
{
239239
_ = stringMap.Get(i);
240240
}
241+
241242
swLookup1.Stop();
242243

243244
// --- Lookup: ReadOnlyDictionary<string>
@@ -246,6 +247,7 @@ public void TestInitializationAndLookupPerformanceComparison()
246247
{
247248
_ = readOnlyMap[i];
248249
}
250+
249251
swLookup2.Stop();
250252

251253
// --- Lookup: ImmutableLookupMapUnmanaged<float>
@@ -254,6 +256,7 @@ public void TestInitializationAndLookupPerformanceComparison()
254256
{
255257
_ = unmanagedMap.Get(i);
256258
}
259+
257260
swLookup3.Stop();
258261

259262
// Dispose unmanaged
@@ -274,6 +277,5 @@ public void TestInitializationAndLookupPerformanceComparison()
274277
Assert.AreEqual(iterations, stringMap.ToList().Count);
275278
Assert.AreEqual(iterations, readOnlyMap.Count);
276279
}
277-
278280
}
279281
}

CommonExtendedObjectsTests/IntListTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public class IntListTests
2323
[TestMethod]
2424
public void AddPopPeekBehavior()
2525
{
26-
using var list = new UnmanagedIntList(4) {10, 20, 30};
26+
using var list = new UnmanagedIntList(4) { 10, 20, 30 };
2727

2828

2929
Assert.AreEqual(3, list.Length);

CommonExtendedObjectsTests/Utilities.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public void BinarySearchPerformanceAndCorrectness()
311311
}
312312

313313
/// <summary>
314-
/// Compares the custom vs array binary search performance.
314+
/// Compares the custom vs array binary search performance.
315315
/// </summary>
316316
[TestMethod]
317317
public void CompareCustomVsArrayBinarySearchPerformance()
0 Bytes
Loading
0 Bytes
Loading

CoreConsole/ConResources.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ internal static class ConResources
4545
/// The resource1
4646
/// </summary>
4747
internal const string ResourceHeader = "header";
48-
49-
internal const string ResourceEventTriggered = "Event triggered. Processing...";
50-
48+
5149
internal const string ResourceEventProcessing = "Event processing completed.";
5250

5351
internal const string ResourceCsExtension = "*.cs";
@@ -77,10 +75,12 @@ internal static class ConResources
7775
internal const string Resource13 = "Error: Command not found.";
7876
internal const string Resource14 = "Directory path is required.";
7977
internal const string Resource15 = "Error: Project path is required.";
80-
internal const string Resource16 = "Resxtract operation completed: No string literals found to extract.";
78+
79+
internal const string ResxtractFinished = "Resxtract operation completed: No string literals found to extract.";
80+
8181
internal const string Resource17 = " - ";
8282

83-
internal const string Resource19 = "\"";
83+
internal const string Quotes = "\"";
8484

8585
internal const string Resource20 = "Loaded {0} files to ignore.";
8686
internal const string Resource21 = "Error loading regex pattern: {0}. Exception: {1}";
@@ -89,7 +89,9 @@ internal static class ConResources
8989

9090
internal const string Resource28 = "Changed files:{0} - {1}";
9191
internal const string Resource3 = "Invalid arguments or operation.";
92+
9293
internal const string Resource4 = "Press any key to exit...";
94+
9395
internal const string Resource5 = "Core Console Application";
9496

9597
/// <summary>

CoreConsole/Program.cs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -278,17 +278,14 @@ private static string HandleResxtract(OutCommand package)
278278
}
279279

280280
var ignoreList = new List<string>();
281-
var ignorePatterns = new List<string>
282-
{
283-
"Resource"
284-
};
281+
var ignorePatterns = new List<string> { "Resource" };
285282

286283
IResourceExtractor extractor = new ResXtract(ignoreList, ignorePatterns);
287284
var changedFiles =
288285
extractor.ProcessProject(projectPath, outputResourceFile, replace: true); // `null` is okay here
289286
if (changedFiles.Count == 0)
290287
{
291-
return ConResources.Resource16;
288+
return ConResources.ResxtractFinished;
292289
}
293290

294291
var actualOutputFile = changedFiles.Last(); // Last item is outputResourceFile (by design)
@@ -340,7 +337,7 @@ private static string CleanPath(string path)
340337
}
341338

342339
path = path.Trim();
343-
if (path.StartsWith(ConResources.Resource19) && path.EndsWith(ConResources.Resource19) && path.Length > 1)
340+
if (path.StartsWith(ConResources.Quotes) && path.EndsWith(ConResources.Quotes) && path.Length > 1)
344341
{
345342
path = path.Substring(1, path.Length - 2);
346343
}

ExtendedSystemObjects/Helper/Enumerator.cs

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,29 @@ namespace ExtendedSystemObjects.Helper
1414
{
1515
/// <inheritdoc />
1616
/// <summary>
17-
/// Enumerator Helper
17+
/// Enumerator Helper
1818
/// </summary>
1919
/// <typeparam name="T">Generic Type, must be unmanaged</typeparam>
2020
/// <seealso cref="T:System.Collections.Generic.IEnumerator`1" />
2121
internal unsafe struct Enumerator<T> : IEnumerator<T> where T : unmanaged
2222
{
2323
/// <summary>
24-
/// The data
24+
/// The data
2525
/// </summary>
2626
private readonly T* _data;
2727

2828
/// <summary>
29-
/// The length
29+
/// The length
3030
/// </summary>
3131
private readonly int _length;
3232

3333
/// <summary>
34-
/// The index
34+
/// The index
3535
/// </summary>
3636
private int _index;
3737

3838
/// <summary>
39-
/// Initializes a new instance of the <see cref="Enumerator{T}"/> struct.
39+
/// Initializes a new instance of the <see cref="Enumerator{T}" /> struct.
4040
/// </summary>
4141
/// <param name="data">The data.</param>
4242
/// <param name="length">The length.</param>
@@ -49,10 +49,10 @@ public Enumerator(T* data, int length)
4949

5050
/// <inheritdoc />
5151
/// <summary>
52-
/// Gets the current.
52+
/// Gets the current.
5353
/// </summary>
5454
/// <value>
55-
/// The current.
55+
/// The current.
5656
/// </value>
5757
public readonly T Current
5858
{
@@ -62,34 +62,44 @@ public readonly T Current
6262

6363
/// <inheritdoc />
6464
/// <summary>
65-
/// Gets the current.
65+
/// Gets the current.
6666
/// </summary>
6767
/// <value>
68-
/// The current.
68+
/// The current.
6969
/// </value>
7070
readonly object IEnumerator.Current => Current;
7171

7272
/// <inheritdoc />
7373
/// <summary>
74-
/// Advances the enumerator to the next element of the collection.
74+
/// Advances the enumerator to the next element of the collection.
7575
/// </summary>
7676
/// <returns>
77-
/// <see langword="true" /> if the enumerator was successfully advanced to the next element; <see langword="false" /> if the enumerator has passed the end of the collection.
77+
/// <see langword="true" /> if the enumerator was successfully advanced to the next element; <see langword="false" />
78+
/// if the enumerator has passed the end of the collection.
7879
/// </returns>
7980
[MethodImpl(MethodImplOptions.AggressiveInlining)]
80-
public bool MoveNext() => ++_index < _length;
81+
public bool MoveNext()
82+
{
83+
return ++_index < _length;
84+
}
8185

8286
/// <inheritdoc />
8387
/// <summary>
84-
/// Sets the enumerator to its initial position, which is before the first element in the collection.
88+
/// Sets the enumerator to its initial position, which is before the first element in the collection.
8589
/// </summary>
8690
[MethodImpl(MethodImplOptions.AggressiveInlining)]
87-
public void Reset() => _index = -1;
91+
public void Reset()
92+
{
93+
_index = -1;
94+
}
8895

8996
/// <inheritdoc />
9097
/// <summary>
91-
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
98+
/// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
9299
/// </summary>
93-
public readonly void Dispose() { /* no resources to clean */ }
100+
public readonly void Dispose()
101+
{
102+
/* no resources to clean */
103+
}
94104
}
95105
}

ExtendedSystemObjects/Helper/SharedRessources.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ internal static class SharedResources
3939
internal const string ErrorValueExists = "Value already exists: ";
4040

4141
/// <summary>
42-
/// The error duplicate key (const). "Duplicate key detected: {key}".
42+
/// The error duplicate key (const). "Duplicate key detected: {key}".
4343
/// </summary>
4444
internal const string ErrorDuplicateKey = "Duplicate key detected: {key}";
4545

0 commit comments

Comments
 (0)