From d4aa1f47ffd6041c51cf0e59b948934482bb5553 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Thu, 30 Nov 2023 00:30:12 +0400 Subject: [PATCH] Add net8.0 target; Update NUnit to 4.0; v2.0.3-rc.1 --- .github/workflows/dotnet.yml | 9 +++++++-- .../Primitives.Linq.Tests.csproj | 8 ++++---- .../YieldExtensionsTest.Single.cs | 4 ++-- .../YielderTest/YielderTest.Empty.cs | 2 +- .../YielderTest/YielderTest.Single.cs | 4 ++-- .../YielderTypedTest/YielderTypedTest.Empty.cs | 2 +- .../YielderTypedTest/YielderTypedTest.Single.cs | 4 ++-- .../Primitives.Linq/Primitives.Linq.csproj | 4 ++-- .../Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs | 2 +- .../PipelineExtensions.Tests/Pipe.cs | 4 ++-- .../Primitives.Pipeline.Tests.csproj | 8 ++++---- .../Primitives.Pipeline/Primitives.Pipeline.csproj | 4 ++-- .../PredicateExtensions.Tests/IsNotNullOrEmpty.cs | 6 +++--- .../IsNotNullOrWhiteSpace.cs | 8 ++++---- .../PredicateExtensions.Tests/IsNotNull_Anonymous.cs | 2 +- .../IsNotNull_NonnullableStruct.cs | 2 +- .../IsNotNull_NullableStruct.cs | 8 ++++---- .../PredicateExtensions.Tests/IsNotNull_RefType.cs | 4 ++-- .../PredicateExtensions.Tests/IsNotNull_String.cs | 4 ++-- .../PredicateExtensions.Tests/IsNullOrEmpty.cs | 6 +++--- .../PredicateExtensions.Tests/IsNullOrWhiteSpace.cs | 8 ++++---- .../PredicateExtensions.Tests/IsNull_Anonymous.cs | 2 +- .../PredicateExtensions.Tests/IsNull_Nonnullable.cs | 2 +- .../IsNull_NullableStruct.cs | 8 ++++---- .../PredicateExtensions.Tests/IsNull_RefType.cs | 4 ++-- .../PredicateExtensions.Tests/IsNull_String.cs | 4 ++-- .../Predicates.Tests/IsNotNullOrEmpty.cs | 6 +++--- .../Predicates.Tests/IsNotNullOrWhiteSpace.cs | 8 ++++---- .../Predicates.Tests/IsNotNull_Anonymous.cs | 2 +- .../Predicates.Tests/IsNotNull_NonnullableStruct.cs | 2 +- .../Predicates.Tests/IsNotNull_NullableStruct.cs | 8 ++++---- .../Predicates.Tests/IsNotNull_RefType.cs | 4 ++-- .../Predicates.Tests/IsNotNull_String.cs | 4 ++-- .../Predicates.Tests/IsNullOrEmpty.cs | 6 +++--- .../Predicates.Tests/IsNullOrWhiteSpace.cs | 8 ++++---- .../Predicates.Tests/IsNull_Anonymous.cs | 2 +- .../Predicates.Tests/IsNull_NonnullableStruct.cs | 2 +- .../Predicates.Tests/IsNull_NullableStruct.cs | 8 ++++---- .../Predicates.Tests/IsNull_RefType.cs | 4 ++-- .../Predicates.Tests/IsNull_String.cs | 4 ++-- .../Primitives.Predicates.Tests.csproj | 8 ++++---- .../Primitives.Predicates.csproj | 4 ++-- .../Primitives.Strings.Tests.csproj | 8 ++++---- .../StringExtensions.Tests/OrEmpty.cs | 4 ++-- .../StringExtensions.Tests/OrNullIfEmpty.cs | 4 ++-- .../StringExtensions.Tests/OrNullIfWhiteSpace.cs | 4 ++-- .../ToStringOrEmpty_Obsolete.cs | 7 ++++--- .../StringExtensions.Tests/ToStringOrEmpty_Ref.cs | 6 +++--- .../ToStringOrEmpty_StructNullable.cs | 6 +++--- .../Primitives.Strings.Tests/Strings.Tests/Empty.cs | 4 ++-- .../Strings.Tests/OrEmpty.cs | 4 ++-- .../Strings.Tests/OrNullIfEmpty.cs | 4 ++-- .../Strings.Tests/OrNullIfWhiteSpace.cs | 4 ++-- .../Strings.Tests/ToStringOrEmpty_Obsolete.cs | 7 ++++--- .../Strings.Tests/ToStringOrEmpty_Ref.cs | 6 +++--- .../Strings.Tests/ToStringOrEmpty_StructNullable.cs | 6 +++--- .../Primitives.Strings/Primitives.Strings.csproj | 4 ++-- src/primitives/Primitives/Primitives.csproj | 12 ++++++------ 58 files changed, 150 insertions(+), 143 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 4dbc4d8..09e583c 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -17,13 +17,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup .NET uses: actions/setup-dotnet@v3 with: dotnet-version: | 6.0.x 7.0.x + 8.0.x # Create Local NuGet Source @@ -116,4 +117,8 @@ jobs: - name: Push Packages if: ${{ github.event_name == 'release' }} - run: dotnet nuget push "../../../nuget/*.nupkg" -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetSourcePassword }} --skip-duplicate + run: > + dotnet nuget push "../../../nuget/*.nupkg" + -s https://api.nuget.org/v3/index.json + -k ${{ secrets.NuGetSourcePassword }} + --skip-duplicate diff --git a/src/primitives-linq/Primitives.Linq.Tests/Primitives.Linq.Tests.csproj b/src/primitives-linq/Primitives.Linq.Tests/Primitives.Linq.Tests.csproj index 91fa69b..fc1a7ec 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/Primitives.Linq.Tests.csproj +++ b/src/primitives-linq/Primitives.Linq.Tests/Primitives.Linq.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.Single.cs b/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.Single.cs index a438cb4..bcd0175 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.Single.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.Single.cs @@ -13,7 +13,7 @@ public void YieldSingle_ExpectCollectionLengthEqualsOne( var actual = sourceValue.YieldSingle(); var actualLength = actual.Count(); - Assert.AreEqual(1, actualLength); + Assert.That(actualLength, Is.EqualTo(1)); } [Test] @@ -24,6 +24,6 @@ public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( var actual = sourceValue.YieldSingle(); var actualFirst = actual.FirstOrDefault(); - Assert.AreSame(sourceValue, actualFirst); + Assert.That(actualFirst, Is.SameAs(sourceValue)); } } diff --git a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Empty.cs b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Empty.cs index f4e05a1..c87c08a 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Empty.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Empty.cs @@ -10,6 +10,6 @@ partial class YielderTest public void YieldEmpty_ExpectEmptyCollection() { var actual = Yielder.YieldEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } } diff --git a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Single.cs b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Single.cs index 04b47f2..c3f26ef 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Single.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Single.cs @@ -13,7 +13,7 @@ public void YieldSingle_ExpectCollectionLengthEqualsOne( var actual = Yielder.YieldSingle(sourceValue); var actualLength = actual.Count(); - Assert.AreEqual(1, actualLength); + Assert.That(actualLength, Is.EqualTo(1)); } [Test] @@ -24,6 +24,6 @@ public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( var actual = Yielder.YieldSingle(sourceValue); var actualFirst = actual.FirstOrDefault(); - Assert.AreSame(sourceValue, actualFirst); + Assert.That(actualFirst, Is.SameAs(sourceValue)); } } diff --git a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Empty.cs b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Empty.cs index 3e8cbc6..7dc1118 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Empty.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Empty.cs @@ -10,6 +10,6 @@ partial class YielderTypedTest public void YieldEmpty_ExpectEmptyCollection() { var actual = Yielder.YieldEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } } diff --git a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Single.cs b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Single.cs index 228c748..2e4bf9f 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Single.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Single.cs @@ -13,7 +13,7 @@ public void YieldSingle_ExpectCollectionLengthEqualsOne( var actual = Yielder.YieldSingle(sourceValue); var actualLength = actual.Count(); - Assert.AreEqual(1, actualLength); + Assert.That(actualLength, Is.EqualTo(1)); } [Test] @@ -24,6 +24,6 @@ public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( var actual = Yielder.YieldSingle(sourceValue); var actualFirst = actual.FirstOrDefault(); - Assert.AreSame(sourceValue, actualFirst); + Assert.That(actualFirst, Is.SameAs(sourceValue)); } } diff --git a/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj b/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj index 29a137d..b0ed826 100644 --- a/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj +++ b/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -17,7 +17,7 @@ PrimeFuncPack Primitives.Linq is a core library for .NET consisting of very basic extensions to work with Linq. System PrimeFuncPack.Primitives.Linq - 2.0.2 + 2.0.3-rc.1 diff --git a/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs b/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs index c4040c7..f09cb18 100644 --- a/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs +++ b/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs @@ -11,6 +11,6 @@ public void Pipe_ExpectSourceValue( object? sourceValue) { var actual = Pipeline.Pipe(sourceValue); - Assert.AreSame(sourceValue, actual); + Assert.That(actual, Is.SameAs(sourceValue)); } } diff --git a/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Pipe.cs b/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Pipe.cs index a4b3de0..3f66528 100644 --- a/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Pipe.cs +++ b/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Pipe.cs @@ -13,7 +13,7 @@ public void Pipe_ExpectMappedSourceValue( { var actual = sourceValue.Pipe(value => (value, PlusFifteen)); var expected = (sourceValue, PlusFifteen); - Assert.AreSame(expected.sourceValue, sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(sourceValue, Is.SameAs(expected.sourceValue)); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/primitives-pipeline/Primitives.Pipeline.Tests/Primitives.Pipeline.Tests.csproj b/src/primitives-pipeline/Primitives.Pipeline.Tests/Primitives.Pipeline.Tests.csproj index b9bdf22..52816d9 100644 --- a/src/primitives-pipeline/Primitives.Pipeline.Tests/Primitives.Pipeline.Tests.csproj +++ b/src/primitives-pipeline/Primitives.Pipeline.Tests/Primitives.Pipeline.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj b/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj index beaae4d..9a15588 100644 --- a/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj +++ b/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -17,7 +17,7 @@ PrimeFuncPack Primitives.Pipeline is a core library for .NET consisting of very basic extensions to work with functional pipelines. System PrimeFuncPack.Primitives.Pipeline - 2.0.2 + 2.0.3-rc.1 diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrEmpty.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrEmpty.cs index e294690..98465fd 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrEmpty.cs @@ -12,7 +12,7 @@ public void IsNotNullOrEmpty_SourceIsNull_ExpectFalse() string? source = null; var actual = source.IsNotNullOrEmpty(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -21,7 +21,7 @@ public void IsNotNullOrEmpty_SourceIsEmpty_ExpectFalse() string source = string.Empty; var actual = source.IsNotNullOrEmpty(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -32,6 +32,6 @@ public void IsNotNullOrEmpty_SourceIsNotEmpty_ExpectTrue( string source) { var actual = source.IsNotNullOrEmpty(); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrWhiteSpace.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrWhiteSpace.cs index 9062adf..00c3432 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrWhiteSpace.cs @@ -12,7 +12,7 @@ public void IsNotNullOrWhiteSpace_SourceIsNull_ExpectFalse() string? source = null; var actual = source.IsNotNullOrWhiteSpace(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -21,7 +21,7 @@ public void IsNotNullOrWhiteSpace_SourceIsEmpty_ExpectFalse() string source = string.Empty; var actual = source.IsNotNullOrWhiteSpace(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -32,7 +32,7 @@ public void IsNotNullOrWhiteSpace_SourceIsWhiteSpace_ExpectFalse( string source) { var actual = source.IsNotNullOrWhiteSpace(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -41,6 +41,6 @@ public void IsNotNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectTrue() var source = SomeString; var actual = source.IsNotNullOrWhiteSpace(); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_Anonymous.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_Anonymous.cs index 8e8b39d..081ef65 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_Anonymous.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_Anonymous.cs @@ -15,6 +15,6 @@ public void IsNotNull_AnonymousValueIsNotNull_ExpectTrue() }; var actual = source.IsNotNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NonnullableStruct.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NonnullableStruct.cs index e8e2141..1a59b9a 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NonnullableStruct.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NonnullableStruct.cs @@ -12,6 +12,6 @@ partial class PredicateExtensionsTests public void IsNotNull_NonnullableStruct_ExpectTrue(int source) { var actual = source.IsNotNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NullableStruct.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NullableStruct.cs index 74afe9a..2b24d5f 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NullableStruct.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_NullableStruct.cs @@ -11,7 +11,7 @@ public void IsNotNull_NullableStructIsNull_CallStructOverload_ExpectFalse() int? source = null; var actual = source.IsNotNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -20,7 +20,7 @@ public void IsNotNull_NullableStructIsNull_CallObjectOverload_ExpectFalse() int? source = null; var actual = source.IsNotNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } // Test both zero and non-zero values @@ -30,7 +30,7 @@ public void IsNotNull_NullableStructIsNull_CallObjectOverload_ExpectFalse() public void IsNotNull_NullableStructIsNotNull_CallStructOverload_ExpectTrue(int? source) { var actual = source.IsNotNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } // Test both zero and non-zero values @@ -40,6 +40,6 @@ public void IsNotNull_NullableStructIsNotNull_CallStructOverload_ExpectTrue(int? public void IsNotNull_NullableStructIsNotNull_CallObjectOverload_ExpectTrue(int? source) { var actual = source.IsNotNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_RefType.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_RefType.cs index eeb9e8f..5970bb4 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_RefType.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_RefType.cs @@ -13,7 +13,7 @@ public void IsNotNull_RefValueIsNull_ExpectFalse() RefType source = null!; var actual = source.IsNotNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -22,6 +22,6 @@ public void IsNotNull_RefValueIsNotNull_ExpectTrue() var source = MinusFifteenIdRefType; var actual = source.IsNotNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_String.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_String.cs index e1e4131..9cda577 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_String.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNull_String.cs @@ -12,7 +12,7 @@ public void IsNotNull_StringIsNull_ExpectFalse() string source = null!; var actual = source.IsNotNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -23,6 +23,6 @@ public void IsNotNull_StringIsNull_ExpectFalse() public void IsNotNull_StringIsNotNull_ExpectTrue(string? source) { var actual = source.IsNotNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrEmpty.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrEmpty.cs index a753045..fb8f068 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrEmpty.cs @@ -12,7 +12,7 @@ public void IsNullOrEmpty_SourceIsNull_ExpectTrue() string? source = null; var actual = source.IsNullOrEmpty(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -21,7 +21,7 @@ public void IsNullOrEmpty_SourceIsEmpty_ExpectTrue() string source = string.Empty; var actual = source.IsNullOrEmpty(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -32,6 +32,6 @@ public void IsNullOrEmpty_SourceIsNotEmpty_ExpectFalse( string source) { var actual = source.IsNullOrEmpty(); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrWhiteSpace.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrWhiteSpace.cs index 84cafe4..a52b7e8 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrWhiteSpace.cs @@ -12,7 +12,7 @@ public void IsNullOrWhiteSpace_SourceIsNull_ExpectTrue() string? source = null; var actual = source.IsNullOrWhiteSpace(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -21,7 +21,7 @@ public void IsNullOrWhiteSpace_SourceIsEmpty_ExpectTrue() string source = string.Empty; var actual = source.IsNullOrWhiteSpace(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -32,7 +32,7 @@ public void IsNullOrWhiteSpace_SourceIsWhiteSpace_ExpectTrue( string source) { var actual = source.IsNullOrWhiteSpace(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -41,6 +41,6 @@ public void IsNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectFalse() var source = SomeString; var actual = source.IsNullOrWhiteSpace(); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Anonymous.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Anonymous.cs index c8277e0..516cf8e 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Anonymous.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Anonymous.cs @@ -15,6 +15,6 @@ public void IsNull_AnonymousValueIsNotNull_ExpectFalse() }; var actual = source.IsNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Nonnullable.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Nonnullable.cs index c35ffa3..bdc5949 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Nonnullable.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_Nonnullable.cs @@ -12,6 +12,6 @@ partial class PredicateExtensionsTests public void IsNull_NonnullableStruct_ExpectFalse(int source) { var actual = source.IsNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_NullableStruct.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_NullableStruct.cs index 7fa1c41..3bcd688 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_NullableStruct.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_NullableStruct.cs @@ -11,7 +11,7 @@ public void IsNull_NullableStructIsNull_CallStructOverload_ExpectTrue() int? source = null; var actual = source.IsNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -20,7 +20,7 @@ public void IsNull_NullableStructIsNull_CallObjectOverload_ExpectTrue() int? source = null; var actual = source.IsNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } // Test both zero and non-zero values @@ -30,7 +30,7 @@ public void IsNull_NullableStructIsNull_CallObjectOverload_ExpectTrue() public void IsNull_NullableStructIsNotNull_CallStructOverload_ExpectFalse(int? source) { var actual = source.IsNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } // Test both zero and non-zero values @@ -40,6 +40,6 @@ public void IsNull_NullableStructIsNotNull_CallStructOverload_ExpectFalse(int? s public void IsNull_NullableStructIsNotNull_CallObjectOverload_ExpectFalse(int? source) { var actual = source.IsNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_RefType.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_RefType.cs index 33e1fed..5558aee 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_RefType.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_RefType.cs @@ -12,7 +12,7 @@ public void IsNull_RefValueIsNull_ExpectTrue() object source = null!; var actual = source.IsNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -21,6 +21,6 @@ public void IsNull_RefValueIsNotNull_ExpectFalse() var source = ZeroIdRefType; var actual = source.IsNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_String.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_String.cs index ad27241..45d9973 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_String.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNull_String.cs @@ -12,7 +12,7 @@ public void IsNull_StringIsNull_ExpectTrue() string source = null!; var actual = source.IsNull(); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -23,6 +23,6 @@ public void IsNull_StringIsNull_ExpectTrue() public void IsNull_StringIsNotNull_ExpectFalse(string? source) { var actual = source.IsNull(); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrEmpty.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrEmpty.cs index 5f000a3..a117b7e 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrEmpty.cs @@ -12,7 +12,7 @@ public void IsNotNullOrEmpty_SourceIsNull_ExpectFalse() string? source = null; var actual = Predicates.IsNotNullOrEmpty(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -21,7 +21,7 @@ public void IsNotNullOrEmpty_SourceIsEmpty_ExpectFalse() string source = string.Empty; var actual = Predicates.IsNotNullOrEmpty(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -32,6 +32,6 @@ public void IsNotNullOrEmpty_SourceIsNotEmpty_ExpectTrue( string source) { var actual = Predicates.IsNotNullOrEmpty(source); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrWhiteSpace.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrWhiteSpace.cs index 801b828..e024ae2 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNullOrWhiteSpace.cs @@ -12,7 +12,7 @@ public void IsNotNullOrWhiteSpace_SourceIsNull_ExpectFalse() string? source = null; var actual = Predicates.IsNotNullOrWhiteSpace(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -21,7 +21,7 @@ public void IsNotNullOrWhiteSpace_SourceIsEmpty_ExpectFalse() string source = string.Empty; var actual = Predicates.IsNotNullOrWhiteSpace(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -32,7 +32,7 @@ public void IsNotNullOrWhiteSpace_SourceIsWhiteSpace_ExpectFalse( string source) { var actual = Predicates.IsNotNullOrWhiteSpace(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -41,6 +41,6 @@ public void IsNotNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectTrue() var source = SomeString; var actual = Predicates.IsNotNullOrWhiteSpace(source); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_Anonymous.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_Anonymous.cs index ee7b4a5..3185603 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_Anonymous.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_Anonymous.cs @@ -15,6 +15,6 @@ public void IsNotNull_AnonymousValueIsNotNull_ExpectTrue() }; var actual = Predicates.IsNotNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NonnullableStruct.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NonnullableStruct.cs index 036362b..87dc256 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NonnullableStruct.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NonnullableStruct.cs @@ -14,6 +14,6 @@ public sealed partial class PredicatesTests public void IsNotNull_NonnullableStruct_ExpectTrue(int source) { var actual = Predicates.IsNotNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NullableStruct.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NullableStruct.cs index 86509d1..49666e7 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NullableStruct.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_NullableStruct.cs @@ -12,7 +12,7 @@ public void IsNotNull_NullableStructIsNull_CallStructOverload_ExpectFalse() int? source = null; var actual = Predicates.IsNotNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -21,7 +21,7 @@ public void IsNotNull_NullableStructIsNull_CallObjectOverload_ExpectFalse() int? source = null; var actual = Predicates.IsNotNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } // Test both some specific cases @@ -32,7 +32,7 @@ public void IsNotNull_NullableStructIsNull_CallObjectOverload_ExpectFalse() public void IsNotNull_NullableStructIsNotNull_CallStructOverload_ExpectTrue(int? source) { var actual = Predicates.IsNotNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } // Test both some specific cases @@ -43,6 +43,6 @@ public void IsNotNull_NullableStructIsNotNull_CallStructOverload_ExpectTrue(int? public void IsNotNull_NullableStructIsNotNull_CallObjectOverload_ExpectTrue(int? source) { var actual = Predicates.IsNotNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_RefType.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_RefType.cs index 6b2f378..546e348 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_RefType.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_RefType.cs @@ -12,7 +12,7 @@ public void IsNotNull_RefValueIsNull_ExpectFalse() object source = null!; var actual = Predicates.IsNotNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -21,6 +21,6 @@ public void IsNotNull_RefValueIsNotNull_ExpectTrue() var source = PlusFifteenIdRefType; var actual = Predicates.IsNotNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_String.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_String.cs index d7b0e05..b3520f1 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_String.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNotNull_String.cs @@ -12,7 +12,7 @@ public void IsNotNull_StringIsNull_ExpectFalse() string source = null!; var actual = Predicates.IsNotNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } [Test] @@ -23,6 +23,6 @@ public void IsNotNull_StringIsNull_ExpectFalse() public void IsNotNull_StringIsNotNull_ExpectTrue(string? source) { var actual = Predicates.IsNotNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrEmpty.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrEmpty.cs index b68e0bc..08e7538 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrEmpty.cs @@ -12,7 +12,7 @@ public void IsNullOrEmpty_SourceIsNull_ExpectTrue() string? source = null; var actual = Predicates.IsNullOrEmpty(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -21,7 +21,7 @@ public void IsNullOrEmpty_SourceIsEmpty_ExpectTrue() string source = string.Empty; var actual = Predicates.IsNullOrEmpty(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -32,6 +32,6 @@ public void IsNullOrEmpty_SourceIsNotEmpty_ExpectFalse( string source) { var actual = Predicates.IsNullOrEmpty(source); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrWhiteSpace.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrWhiteSpace.cs index 282c8ec..89a0ccc 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNullOrWhiteSpace.cs @@ -12,7 +12,7 @@ public void IsNullOrWhiteSpace_SourceIsNull_ExpectTrue() string? source = null; var actual = Predicates.IsNullOrWhiteSpace(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -21,7 +21,7 @@ public void IsNullOrWhiteSpace_SourceIsEmpty_ExpectTrue() string source = string.Empty; var actual = Predicates.IsNullOrWhiteSpace(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -32,7 +32,7 @@ public void IsNullOrWhiteSpace_SourceIsWhiteSpace_ExpectTrue( string source) { var actual = Predicates.IsNullOrWhiteSpace(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -41,6 +41,6 @@ public void IsNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectFalse() var source = SomeString; var actual = Predicates.IsNullOrWhiteSpace(source); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_Anonymous.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_Anonymous.cs index 83b9d11..18a9d2b 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_Anonymous.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_Anonymous.cs @@ -15,6 +15,6 @@ public void IsNull_AnonymousValueIsNotNull_ExpectFalse() }; var actual = Predicates.IsNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NonnullableStruct.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NonnullableStruct.cs index 8fd945f..6535c2d 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NonnullableStruct.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NonnullableStruct.cs @@ -14,6 +14,6 @@ partial class PredicatesTests public void IsNull_NonnullableStruct_ExpectFalse(int source) { var actual = Predicates.IsNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NullableStruct.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NullableStruct.cs index 25adb43..bd21652 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NullableStruct.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_NullableStruct.cs @@ -12,7 +12,7 @@ public void IsNull_NullableStructIsNull_CallStructOverload_ExpectTrue() int? source = null; var actual = Predicates.IsNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -21,7 +21,7 @@ public void IsNull_NullableStructIsNull_CallObjectOverload_ExpectTrue() int? source = null; var actual = Predicates.IsNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } // Test both some specific cases @@ -32,7 +32,7 @@ public void IsNull_NullableStructIsNull_CallObjectOverload_ExpectTrue() public void IsNull_NullableStructIsNotNull_CallStructOverload_ExpectFalse(int? source) { var actual = Predicates.IsNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } // Test both some specific cases @@ -43,6 +43,6 @@ public void IsNull_NullableStructIsNotNull_CallStructOverload_ExpectFalse(int? s public void IsNull_NullableStructIsNotNull_CallObjectOverload_ExpectFalse(int? source) { var actual = Predicates.IsNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_RefType.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_RefType.cs index f1b36b9..2da1743 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_RefType.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_RefType.cs @@ -13,7 +13,7 @@ public void IsNull_RefValueIsNull_ExpectTrue() RefType source = null!; var actual = Predicates.IsNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -22,6 +22,6 @@ public void IsNull_RefValueIsNull_ExpectFalse() var source = MinusFifteenIdRefType; var actual = Predicates.IsNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_String.cs b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_String.cs index ba023d3..e1c0786 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_String.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Predicates.Tests/IsNull_String.cs @@ -12,7 +12,7 @@ public void IsNull_StringIsNull_ExpectTrue() string source = null!; var actual = Predicates.IsNull(source); - Assert.True(actual); + Assert.That(actual, Is.True); } [Test] @@ -23,6 +23,6 @@ public void IsNull_StringIsNull_ExpectTrue() public void IsNull_StringIsNotNull_ExpectFalse(string? source) { var actual = Predicates.IsNull(source); - Assert.False(actual); + Assert.That(actual, Is.False); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/Primitives.Predicates.Tests.csproj b/src/primitives-predicates/Primitives.Predicates.Tests/Primitives.Predicates.Tests.csproj index 7b9f0c7..7b2863a 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/Primitives.Predicates.Tests.csproj +++ b/src/primitives-predicates/Primitives.Predicates.Tests/Primitives.Predicates.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj b/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj index abba93c..3dad953 100644 --- a/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj +++ b/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -17,7 +17,7 @@ PrimeFuncPack Primitives.Predicates is a core library for .NET consisting of very basic extensions to work with the nullable feature and strings. System PrimeFuncPack.Primitives.Predicates - 2.0.2 + 2.0.3-rc.1 diff --git a/src/primitives-strings/Primitives.Strings.Tests/Primitives.Strings.Tests.csproj b/src/primitives-strings/Primitives.Strings.Tests/Primitives.Strings.Tests.csproj index c576efd..2897996 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Primitives.Strings.Tests.csproj +++ b/src/primitives-strings/Primitives.Strings.Tests/Primitives.Strings.Tests.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -14,9 +14,9 @@ - - - + + + diff --git a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrEmpty.cs b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrEmpty.cs index bc050c9..22045be 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrEmpty.cs @@ -12,7 +12,7 @@ public void OrEmpty_SourceIsNull_ExpectEmpty() string? source = null; var actual = source.OrEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Test] @@ -24,6 +24,6 @@ public void OrEmpty_SourceIsNotNull_ExpectSourceValue( string source) { var actual = source.OrEmpty(); - Assert.AreSame(source, actual); + Assert.That(actual, Is.SameAs(source)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfEmpty.cs b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfEmpty.cs index 0273fc4..131d75b 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfEmpty.cs @@ -12,7 +12,7 @@ public void OrNullIfEmpty_SourceIsEmpty_ExpectNull() string? source = string.Empty; var actual = source.OrNullIfEmpty(); - Assert.IsNull(actual); + Assert.That(actual, Is.Null); } [Test] @@ -24,6 +24,6 @@ public void OrNullIfEmpty_SourceIsNotEmpty_ExpectSourceValue( string? source) { var actual = source.OrNullIfEmpty(); - Assert.AreSame(source, actual); + Assert.That(actual, Is.SameAs(source)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfWhiteSpace.cs b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfWhiteSpace.cs index 3bfd20a..aa7493a 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfWhiteSpace.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfWhiteSpace.cs @@ -15,7 +15,7 @@ public void OrNullIfWhiteSpace_SourceIsWhiteSpace_ExpectNull( string? source) { var actual = source.OrNullIfWhiteSpace(); - Assert.IsNull(actual); + Assert.That(actual, Is.Null); } [Test] @@ -25,6 +25,6 @@ public void OrNullIfWhiteSpace_SourceIsNotWhiteSpace_ExpectSourceValue( string? source) { var actual = source.OrNullIfWhiteSpace(); - Assert.AreSame(source, actual); + Assert.That(actual, Is.SameAs(source)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Obsolete.cs b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Obsolete.cs index b4869b5..5404400 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Obsolete.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Obsolete.cs @@ -18,9 +18,9 @@ public void ToStringOrEmpty_ExpectIsObsoleteWithError() .Where(method => method.Name == nameof(StringExtensions.ToStringOrEmpty)) .ToArray(); - Assert.AreEqual(2, methods.Count); + Assert.That(methods.Count, Is.EqualTo(2)); - Assert.IsTrue( + Assert.That( methods.All( method => method.CustomAttributes.Any( attr @@ -30,6 +30,7 @@ public void ToStringOrEmpty_ExpectIsObsoleteWithError() attr.ConstructorArguments[0].ArgumentType == typeof(string) && attr.ConstructorArguments[0].Value is expectedObsoleteMessage && attr.ConstructorArguments[1].ArgumentType == typeof(bool) && - attr.ConstructorArguments[1].Value is true))); + attr.ConstructorArguments[1].Value is true)), + Is.True); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Ref.cs b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Ref.cs index e9f1add..c607c0b 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Ref.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_Ref.cs @@ -13,7 +13,7 @@ public void ToStringOrEmpty_Ref_SourceIsNull_ExpectEmpty() ToStringStubRefType? source = null; var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -23,7 +23,7 @@ public void ToStringOrEmpty_Ref_SourceToStringIsNull_ExpectEmpty() ToStringStubRefType? source = new(null); var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -38,6 +38,6 @@ public void ToStringOrEmpty_Ref_SourceToStringIsNotNull_ExpectActualToStringValu ToStringStubRefType? source = new(sourceToStringValue); var actual = source.ToStringOrEmpty(); - Assert.AreEqual(sourceToStringValue, actual); + Assert.That(actual, Is.EqualTo(sourceToStringValue)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_StructNullable.cs b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_StructNullable.cs index 26cd032..72188aa 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_StructNullable.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/ToStringOrEmpty_StructNullable.cs @@ -13,7 +13,7 @@ public void ToStringOrEmpty_StructNullable_SourceIsNull_ExpectEmpty() ToStringStubStructType? source = null; var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -23,7 +23,7 @@ public void ToStringOrEmpty_StructNullable_SourceToStringIsNull_ExpectEmpty() ToStringStubStructType? source = new(null); var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -38,6 +38,6 @@ public void ToStringOrEmpty_StructNullable_SourceToStringIsNotNull_ExpectActualT ToStringStubStructType? source = new(sourceToStringValue); var actual = source.ToStringOrEmpty(); - Assert.AreEqual(sourceToStringValue, actual); + Assert.That(actual, Is.EqualTo(sourceToStringValue)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Empty.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Empty.cs index 9fc2a90..56d92de 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Empty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Empty.cs @@ -9,13 +9,13 @@ partial class StringsTests public void Empty_ExpectEmptyString() { var actual = Strings.Empty; - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Test] public void GetEmpty_ExpectEmptyString() { var actual = Strings.GetEmpty(); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrEmpty.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrEmpty.cs index 9dd8951..c384f9f 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrEmpty.cs @@ -12,7 +12,7 @@ public void OrEmpty_SourceIsNull_ExpectEmpty() string? source = null; var actual = Strings.OrEmpty(source); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Test] @@ -24,6 +24,6 @@ public void OrEmpty_SourceIsNotNull_ExpectSourceValue( string source) { var actual = Strings.OrEmpty(source); - Assert.AreSame(source, actual); + Assert.That(actual, Is.SameAs(source)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfEmpty.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfEmpty.cs index 6bb4a4d..4177a27 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfEmpty.cs @@ -12,7 +12,7 @@ public void OrNullIfEmpty_SourceIsEmpty_ExpectNull() string? source = string.Empty; var actual = Strings.OrNullIfEmpty(source); - Assert.IsNull(actual); + Assert.That(actual, Is.Null); } [Test] @@ -24,6 +24,6 @@ public void OrNullIfEmpty_SourceIsNotEmpty_ExpectSourceValue( string? source) { var actual = Strings.OrNullIfEmpty(source); - Assert.AreSame(source, actual); + Assert.That(actual, Is.SameAs(source)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfWhiteSpace.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfWhiteSpace.cs index 290e8ea..702a14b 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfWhiteSpace.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfWhiteSpace.cs @@ -15,7 +15,7 @@ public void OrNullIfWhiteSpace_SourceIsWhiteSpace_ExpectNull( string? source) { var actual = Strings.OrNullIfWhiteSpace(source); - Assert.IsNull(actual); + Assert.That(actual, Is.Null); } [Test] @@ -25,6 +25,6 @@ public void OrNullIfWhiteSpace_SourceIsNotWhiteSpace_ExpectSourceValue( string? source) { var actual = Strings.OrNullIfWhiteSpace(source); - Assert.AreSame(source, actual); + Assert.That(actual, Is.SameAs(source)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Obsolete.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Obsolete.cs index 938d94a..1bc8052 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Obsolete.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Obsolete.cs @@ -18,9 +18,9 @@ public void ToStringOrEmpty_ExpectIsObsoleteWithError() .Where(method => method.Name == nameof(Strings.ToStringOrEmpty)) .ToArray(); - Assert.AreEqual(2, methods.Count); + Assert.That(methods.Count, Is.EqualTo(2)); - Assert.IsTrue( + Assert.That( methods.All( method => method.CustomAttributes.Any( attr @@ -30,6 +30,7 @@ public void ToStringOrEmpty_ExpectIsObsoleteWithError() attr.ConstructorArguments[0].ArgumentType == typeof(string) && attr.ConstructorArguments[0].Value is expectedObsoleteMessage && attr.ConstructorArguments[1].ArgumentType == typeof(bool) && - attr.ConstructorArguments[1].Value is true))); + attr.ConstructorArguments[1].Value is true)), + Is.True); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Ref.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Ref.cs index 1382e10..3106c92 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Ref.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_Ref.cs @@ -13,7 +13,7 @@ public void ToStringOrEmpty_Ref_SourceIsNull_ExpectEmpty() ToStringStubRefType? source = null; var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -23,7 +23,7 @@ public void ToStringOrEmpty_Ref_SourceToStringIsNull_ExpectEmpty() ToStringStubRefType? source = new(null); var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -38,6 +38,6 @@ public void ToStringOrEmpty_Ref_SourceToStringIsNotNull_ExpectActualToStringValu ToStringStubRefType? source = new(sourceToStringValue); var actual = Strings.ToStringOrEmpty(source); - Assert.AreEqual(sourceToStringValue, actual); + Assert.That(actual, Is.EqualTo(sourceToStringValue)); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_StructNullable.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_StructNullable.cs index be569cf..114ff7a 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_StructNullable.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/ToStringOrEmpty_StructNullable.cs @@ -13,7 +13,7 @@ public void ToStringOrEmpty_StructNullable_SourceIsNull_ExpectEmpty() ToStringStubStructType? source = null; var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -23,7 +23,7 @@ public void ToStringOrEmpty_StructNullable_SourceToStringIsNull_ExpectEmpty() ToStringStubStructType? source = new(null); var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); + Assert.That(actual, Is.Empty); } [Obsolete] @@ -38,6 +38,6 @@ public void ToStringOrEmpty_StructNullable_SourceToStringIsNotNull_ExpectActualT ToStringStubStructType? source = new(sourceToStringValue); var actual = Strings.ToStringOrEmpty(source); - Assert.AreEqual(sourceToStringValue, actual); + Assert.That(actual, Is.EqualTo(sourceToStringValue)); } } diff --git a/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj b/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj index 193e6cc..2fe763d 100644 --- a/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj +++ b/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -17,7 +17,7 @@ PrimeFuncPack Primitives.Strings is a core library for .NET consisting of very basic extensions to work with strings. System PrimeFuncPack.Primitives.Strings - 2.0.2 + 2.0.3-rc.1 diff --git a/src/primitives/Primitives/Primitives.csproj b/src/primitives/Primitives/Primitives.csproj index 8658302..833d517 100644 --- a/src/primitives/Primitives/Primitives.csproj +++ b/src/primitives/Primitives/Primitives.csproj @@ -1,7 +1,7 @@ - net6.0;net7.0 + net6.0;net7.0;net8.0 disable enable true @@ -17,7 +17,7 @@ PrimeFuncPack Primitives is a core library pack for .NET consisting of very basic extensions to work with functional pipelines, Linq, strings, the nullable feature, etc. System PrimeFuncPack.Primitives - 2.0.2 + 2.0.3-rc.1 @@ -32,10 +32,10 @@ - - - - + + + +