Skip to content

Commit 6883de3

Browse files
Fixed a unit test. Code cleanup.
1 parent 8869c42 commit 6883de3

27 files changed

+13457
-280
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,3 +359,4 @@ MigrationBackup/
359359
/source/.cr/team/Options/StorageStreams.xml
360360
/source/6/Benchmarking/dotNetTips.Spargine.6.Benchmarking/.cr/personal/FavoritesList/List.xml
361361
/source/6
362+
/docs/NDepend/NDependOut3

docs/NDepend/dotNetTips.Spargine.6.ndproj

Lines changed: 13124 additions & 0 deletions
Large diffs are not rendered by default.

source/6/Unit Tests/dotNetTips.Spargine.Extensions.Tests/StringExtensionsTests.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Created : 12-17-2020
55
//
66
// Last Modified By : David McCarter
7-
// Last Modified On : 07-31-2022
7+
// Last Modified On : 08-06-2022
88
// ***********************************************************************
99
// <copyright file="StringExtensionsTests.cs" company="dotNetTips.Spargine.Extensions.Tests">
1010
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
@@ -56,9 +56,9 @@ public void SplitLinesTest()
5656
var text = Resources.TestMutipleLinesOfText;
5757
try
5858
{
59-
foreach (ReadOnlySpan<char> line in text.SplitLines())
59+
foreach (LineSplitEntry lse in text.SplitLines())
6060
{
61-
Console.WriteLine(line.ToString());
61+
Console.WriteLine(lse.Line.ToString());
6262
}
6363
}
6464
catch
@@ -138,8 +138,8 @@ public void IsCurrencyCode()
138138
[TestMethod]
139139
public void IsOneToSevenAlphaTest()
140140
{
141-
var goodCode = RandomData.GenerateWord(7);
142-
var badCode = RandomData.GenerateWord(10);
141+
var goodCode = RandomData.GenerateWord(7, 'A', 'Z');
142+
var badCode = RandomData.GenerateWord(25, 'A', 'Z');
143143

144144
Assert.IsTrue(goodCode.IsOneToSevenAlpha());
145145

source/6/Unit Tests/dotNetTips.Spargine.Tester.Tests/RandomDataTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ private void DeleteFiles(IEnumerable<string> files)
7070
}
7171
catch (Exception ex) when (ex is ArgumentException ||
7272
ex is ArgumentNullException ||
73-
ex is System.IO.DirectoryNotFoundException ||
73+
ex is DirectoryNotFoundException ||
7474
ex is IOException ||
7575
ex is NotSupportedException ||
7676
ex is PathTooLongException ||

source/6/dotNetTips.Spargine.6.Core/App.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Created : 11-11-2020
55
//
66
// Last Modified By : David McCarter
7-
// Last Modified On : 05-23-2022
7+
// Last Modified On : 07-13-2022
88
// ***********************************************************************
99
// <copyright file="App.cs" company="McCarter Consulting">
1010
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
@@ -28,6 +28,7 @@ namespace DotNetTips.Spargine.Core
2828
/// </summary>
2929
public static class App
3030
{
31+
3132
/// <summary>
3233
/// The temporary ASP files location.
3334
/// </summary>
@@ -157,7 +158,7 @@ public static bool IsRunningFromAspNet()
157158
/// Determines whether user is administrator.
158159
/// </summary>
159160
/// <returns><c>true</c> if [is user administrator]; otherwise, <c>false</c>.</returns>
160-
/// <exception cref="PlatformNotSupportedException"></exception>
161+
/// <exception cref="System.PlatformNotSupportedException"></exception>
161162
[Information(UnitTestCoverage = 100, Status = Status.Available, Documentation = "https://bit.ly/SpargineJun2021")]
162163
public static bool IsUserAdministrator()
163164
{
@@ -329,5 +330,6 @@ public static void RunAsAdministrator()
329330
/// <value>The working set.</value>
330331
[Information(UnitTestCoverage = 100, Status = Status.Available, Documentation = "https://bit.ly/SpargineJun2021")]
331332
public static long WorkingSet => Environment.WorkingSet;
333+
332334
}
333335
}

source/6/dotNetTips.Spargine.6.Core/Logging/LoggingHelper.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Created : 09-28-2020
55
//
66
// Last Modified By : David McCarter
7-
// Last Modified On : 07-14-2022
7+
// Last Modified On : 08-06-2022
88
// ***********************************************************************
99
// <copyright file="LoggingHelper.cs" company="dotNetTips.Spargine.Core">
1010
// Copyright (c) McCarter Consulting. All rights reserved.
@@ -24,6 +24,7 @@ namespace DotNetTips.Spargine.Core.Logging
2424
/// </summary>
2525
public static class LoggingHelper
2626
{
27+
2728
/// <summary>
2829
/// The application domain exception logger
2930
/// </summary>
@@ -79,7 +80,7 @@ private static void CurrentDomain_FirstChanceException(object sender, FirstChanc
7980
///// <exception cref="ArgumentNullException">logger</exception>
8081
///// <exception cref="ArgumentException">'{nameof(message)}' cannot be null or empty. - message</exception>
8182
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
82-
//[Information(nameof(FastLogger), author: "David McCarter", createdOn: "3/21/2022", UnitTestCoverage = 0, BenchMarkStatus = BenchMarkStatus.None, Status = Status.New, Documentation = "ADD URL")]
83+
//[Information(nameof(FastLogger), author: "David McCarter", createdOn: "3/21/2022", UnitTestCoverage = 0, BenchMarkStatus = BenchMarkStatus.None, Status = Status.Available, Documentation = "ADD URL")]
8384
//public static void FastLogger([NotNull] ILogger logger, LogLevel logLevel, string message, [AllowNull] Exception ex)
8485
//{
8586
// logger = logger.ArgumentNotNull();
@@ -267,5 +268,6 @@ public static Exception[] RetrieveAllExceptions([NotNull] Exception exception)
267268

268269
return collection.ToArray();
269270
}
271+
270272
}
271273
}

source/6/dotNetTips.Spargine.6.Core/MessageNotQueuedException.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Created : 09-28-2020
55
//
66
// Last Modified By : David McCarter
7-
// Last Modified On : 01-21-2022
7+
// Last Modified On : 07-17-2022
88
// ***********************************************************************
99
// <copyright file="MessageNotQueuedException.cs" company="dotNetTips.Spargine.Core">
1010
// Copyright (c) McCarter Consulting. All rights reserved.
@@ -26,6 +26,17 @@ namespace DotNetTips.Spargine.Core
2626
[Serializable]
2727
public class MessageNotQueuedException : LoggableException
2828
{
29+
30+
/// <summary>
31+
/// Initializes a new instance of the <see cref="MessageNotQueuedException" /> class.
32+
/// </summary>
33+
/// <param name="serializationInfo">The serialization information.</param>
34+
/// <param name="streamingContext">The streaming context.</param>
35+
/// <exception cref="NotImplementedException">The exception.</exception>
36+
/// <exception cref="NotImplementedException">The exception.</exception>
37+
protected MessageNotQueuedException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext)
38+
{
39+
}
2940
/// <summary>
3041
/// Initializes a new instance of the <see cref="MessageNotQueuedException" /> class.
3142
/// </summary>
@@ -66,13 +77,12 @@ public MessageNotQueuedException(string message, Exception innerException) : bas
6677
public MessageNotQueuedException(string message, string messageId, Exception innerException) : base(message, innerException) => this.MessageId = messageId;
6778

6879
/// <summary>
69-
/// Initializes a new instance of the <see cref="MessageNotQueuedException" /> class.
80+
/// Initializes a new instance of the <see cref="MessageNotQueuedException"/> class.
7081
/// </summary>
71-
/// <param name="serializationInfo">The serialization information.</param>
72-
/// <param name="streamingContext">The streaming context.</param>
73-
/// <exception cref="NotImplementedException">The exception.</exception>
74-
/// <exception cref="NotImplementedException">The exception.</exception>
75-
protected MessageNotQueuedException(SerializationInfo serializationInfo, StreamingContext streamingContext) : base(serializationInfo, streamingContext)
82+
/// <param name="message">The message.</param>
83+
/// <param name="ex">The ex.</param>
84+
/// <param name="userMessage">The user message.</param>
85+
public MessageNotQueuedException(string message, Exception ex, string userMessage) : base(message, ex, userMessage)
7686
{
7787
}
7888

@@ -81,5 +91,6 @@ protected MessageNotQueuedException(SerializationInfo serializationInfo, Streami
8191
/// </summary>
8292
/// <value>The message identifier.</value>
8393
public string MessageId { get; }
94+
8495
}
8596
}

source/6/dotNetTips.Spargine.6.Core/Validator.Argument.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Created : 02-16-2022
55
//
66
// Last Modified By : David McCarter
7-
// Last Modified On : 06-02-2022
7+
// Last Modified On : 08-06-2022
88
// ***********************************************************************
99
// <copyright file="Validator.Argument.cs" company="David McCarter - dotNetTips.com">
1010
// McCarter Consulting (David McCarter)
@@ -26,6 +26,7 @@ namespace DotNetTips.Spargine.Core
2626
/// </summary>
2727
public static partial class Validator
2828
{
29+
2930
/// <summary>
3031
/// Creates the exception message.
3132
/// </summary>
@@ -470,7 +471,7 @@ public static IEnumerable<T> ArgumentItemsExists<T>(this IEnumerable<T> input, s
470471
///// <param name="errorMessage">The error message.</param>
471472
///// <param name="paramName">Name of the parameter.</param>
472473
///// <returns>IReadOnlyList&lt;T&gt;.</returns>
473-
//[Information(nameof(ArgumentItemsExists), "David McCarter", "5/25/2022", UnitTestCoverage = 0, BenchMarkStatus = BenchMarkStatus.NotRequired, Status = Status.New)]
474+
//[Information(nameof(ArgumentItemsExists), "David McCarter", "5/25/2022", UnitTestCoverage = 0, BenchMarkStatus = BenchMarkStatus.NotRequired, Status = Status.Available)]
474475
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
475476
//public static IReadOnlyList<T> ArgumentItemsExists<T>(this IReadOnlyList<T> input, string errorMessage = "", [CallerArgumentExpression("input")] string paramName = "")
476477
//{
@@ -492,7 +493,7 @@ public static IEnumerable<T> ArgumentItemsExists<T>(this IEnumerable<T> input, s
492493
///// <param name="errorMessage">The error message.</param>
493494
///// <param name="paramName">Name of the parameter.</param>
494495
///// <returns>IReadOnlyCollection&lt;T&gt;.</returns>
495-
//[Information(nameof(ArgumentItemsExists), "David McCarter", "5/27/2022", UnitTestCoverage = 0, BenchMarkStatus = BenchMarkStatus.NotRequired, Status = Status.New)]
496+
//[Information(nameof(ArgumentItemsExists), "David McCarter", "5/27/2022", UnitTestCoverage = 0, BenchMarkStatus = BenchMarkStatus.NotRequired, Status = Status.Available)]
496497
//[MethodImpl(MethodImplOptions.AggressiveInlining)]
497498
//public static IReadOnlyCollection<T> ArgumentItemsExists<T>(this IReadOnlyCollection<T> input, string errorMessage = "", [CallerArgumentExpression("input")] string paramName = "")
498499
//{
@@ -838,5 +839,6 @@ public static ICollection<T> ArgumentNotReadOnly<T>(this ICollection<T> input, s
838839

839840
return input!;
840841
}
842+
841843
}
842844
}

source/6/dotNetTips.Spargine.6.Extensions/ArrayExtensions.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Created : 11-21-2020
55
//
66
// Last Modified By : David McCarter
7-
// Last Modified On : 07-17-2022
7+
// Last Modified On : 08-06-2022
88
// ***********************************************************************
99
// <copyright file="ArrayExtensions.cs" company="dotNetTips.Spargine.6.Extensions">
1010
// Copyright (c) David McCarter - dotNetTips.com. All rights reserved.
@@ -278,7 +278,7 @@ public static bool ContainsAny<T>([NotNull] this T[] array, [NotNull] params T[]
278278
/// <typeparam name="T"></typeparam>
279279
/// <param name="list">The list.</param>
280280
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
281-
[Information(nameof(DoesNotHaveItems), author: "David McCarter", createdOn: "6/17/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.New, Documentation = "ADD URL")]
281+
[Information(nameof(DoesNotHaveItems), author: "David McCarter", createdOn: "6/17/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.Available, Documentation = "ADD URL")]
282282
public static bool DoesNotHaveItems<T>([AllowNull] this T[] list)
283283
{
284284
if (list is null)
@@ -335,7 +335,7 @@ public static int GenerateHashCode<T>([NotNull] this T[] array)
335335
/// <param name="array">The array.</param>
336336
/// <returns><c>true</c> if the specified array has items; otherwise, <c>false</c>.</returns>
337337
[MethodImpl(MethodImplOptions.AggressiveInlining)]
338-
[Information(nameof(HasItems), author: "David McCarter", createdOn: "6/15/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.New, Documentation = "ADD URL")]
338+
[Information(nameof(HasItems), author: "David McCarter", createdOn: "6/15/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.Available, Documentation = "ADD URL")]
339339
public static bool HasItems<T>([AllowNull] this T[] array)
340340
{
341341
if (array is null)
@@ -356,7 +356,7 @@ public static bool HasItems<T>([AllowNull] this T[] array)
356356
/// <param name="action">The action.</param>
357357
/// <returns><c>true</c> if the specified action has items; otherwise, <c>false</c>.</returns>
358358
[MethodImpl(MethodImplOptions.AggressiveInlining)]
359-
[Information(nameof(HasItems), author: "David McCarter", createdOn: "6/15/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.New, Documentation = "ADD URL")]
359+
[Information(nameof(HasItems), author: "David McCarter", createdOn: "6/15/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.Available, Documentation = "ADD URL")]
360360
public static bool HasItems<T>([AllowNull] this T[] array, [NotNull] Func<T, bool> action)
361361
{
362362
if (array is null || action is null)
@@ -377,7 +377,7 @@ public static bool HasItems<T>([AllowNull] this T[] array, [NotNull] Func<T, boo
377377
/// <param name="count">The count.</param>
378378
/// <returns><c>true</c> if the specified count has items; otherwise, <c>false</c>.</returns>
379379
[MethodImpl(MethodImplOptions.AggressiveInlining)]
380-
[Information(nameof(HasItems), author: "David McCarter", createdOn: "6/15/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.New, Documentation = "ADD URL")]
380+
[Information(nameof(HasItems), author: "David McCarter", createdOn: "6/15/2022", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.Completed, Status = Status.Available, Documentation = "ADD URL")]
381381
public static bool HasItems<T>([AllowNull] this T[] array, int count)
382382
{
383383
if (array is null)

source/6/dotNetTips.Spargine.6.Extensions/CollectionExtensions.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Created : 11-21-2020
55
//
66
// Last Modified By : David McCarter
7-
// Last Modified On : 07-17-2022
7+
// Last Modified On : 07-26-2022
88
// ***********************************************************************
99
// <copyright file="CollectionExtensions.cs" company="David McCarter - dotNetTips.com">
1010
// McCarter Consulting (David McCarter)
@@ -25,6 +25,7 @@ namespace DotNetTips.Spargine.Extensions
2525
/// </summary>
2626
public static class CollectionExtensions
2727
{
28+
2829
/// <summary>
2930
/// Adds item to the <see cref="ICollection{T}" /> if the condition is meet.
3031
/// Validates that <paramref name="collection" /> and <paramref name="item" /> is not null.
@@ -122,9 +123,9 @@ public static bool AddIfNotExists<T>([NotNull] this ICollection<T> collection, [
122123
/// <exception cref="ArgumentReadOnlyException">List cannot be read-only.</exception>
123124
/// <exception cref="ArgumentNullException">Collection cannot be <see langword="null" />.</exception>
124125
/// <example>
125-
/// <code>
126-
/// people.AddIfNotExists(person, comparer)
127-
/// </code>
126+
/// <code>
127+
/// people.AddIfNotExists(person, comparer)
128+
/// </code>
128129
/// </example>
129130
[Information("From .NET Core source.", author: "David McCarter", createdOn: "7/15/2020", UnitTestCoverage = 100, BenchMarkStatus = BenchMarkStatus.None, Status = Status.Available)]
130131
public static bool AddIfNotExists<T>([NotNull] this ICollection<T> collection, [NotNull] T item, [NotNull] IEqualityComparer<T> comparer)
@@ -159,7 +160,7 @@ public static bool AddIfNotExists<T>([NotNull] this ICollection<T> collection, [
159160
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
160161
/// <exception cref="ArgumentReadOnlyException">Collection cannot be read-only.</exception>
161162
/// <example>
162-
/// <code>
163+
/// <code>
163164
/// people.AddRange(personCollection, Tristate.UseDefault)
164165
/// </code>
165166
/// </example>
@@ -305,5 +306,6 @@ public static void Upsert([NotNull] this ICollection<IDataRecord> collection, [N
305306

306307
collection.Add(item);
307308
}
309+
308310
}
309311
}

0 commit comments

Comments
 (0)