diff --git a/docs/primitives-linq/README.md b/docs/primitives-linq/README.md new file mode 100644 index 0000000..3e6980f --- /dev/null +++ b/docs/primitives-linq/README.md @@ -0,0 +1,2 @@ +# PrimeFuncPack Primitives.Linq +PrimeFuncPack Primitives.Linq is a core library for .NET consisting of useful extensions making work with Linq easier. diff --git a/docs/primitives-pipeline/README.md b/docs/primitives-pipeline/README.md new file mode 100644 index 0000000..1432e6a --- /dev/null +++ b/docs/primitives-pipeline/README.md @@ -0,0 +1,2 @@ +# PrimeFuncPack Primitives.Pipeline +PrimeFuncPack Primitives.Pipeline is a core library for .NET consisting of useful extensions making work with functional pipelines easier. diff --git a/docs/primitives-predicates/README.md b/docs/primitives-predicates/README.md new file mode 100644 index 0000000..8437fa3 --- /dev/null +++ b/docs/primitives-predicates/README.md @@ -0,0 +1,2 @@ +# PrimeFuncPack Primitives.Predicates +PrimeFuncPack Primitives.Predicates is a core library for .NET consisting of useful extensions and predicates making work with the nullable feature easier. diff --git a/docs/primitives-strings/README.md b/docs/primitives-strings/README.md new file mode 100644 index 0000000..6bdf14d --- /dev/null +++ b/docs/primitives-strings/README.md @@ -0,0 +1,2 @@ +# PrimeFuncPack Primitives.Strings +PrimeFuncPack Primitives.Strings is a core library for .NET consisting of useful extensions making work with strings easier. diff --git a/docs/primitives/README.md b/docs/primitives/README.md new file mode 100644 index 0000000..5bc1168 --- /dev/null +++ b/docs/primitives/README.md @@ -0,0 +1,2 @@ +# PrimeFuncPack Primitives +PrimeFuncPack Primitives is a core library for .NET consisting of useful extensions and predicates making work with functional pipelines, Linq, strings, the nullable feature, etc. easier. diff --git a/src/primitives-linq/Primitives.Linq.Tests/TestData/ObjectTestData.cs b/src/primitives-linq/Primitives.Linq.Tests/TestData/ObjectTestData.cs index 4439b6e..2b8e460 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/TestData/ObjectTestData.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/TestData/ObjectTestData.cs @@ -4,18 +4,17 @@ using System.Linq; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +internal static class ObjectTestData { - internal static class ObjectTestData - { - public static IEnumerable NullableObjectTestSource - => - new object?[] - { - null, - PlusFifteenIdRefType, - SomeTextStructType - } - .Select(v => new object?[] { v }); - } + public static IEnumerable NullableObjectTestSource + => + new object?[] + { + null, + PlusFifteenIdRefType, + SomeTextStructType + } + .Select(v => new object?[] { v }); } 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 4280e14..342bee7 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.Single.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.Single.cs @@ -3,30 +3,29 @@ using NUnit.Framework; using System.Linq; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class YieldExtensionsTest { - partial class YieldExtensionsTest + [Test] + [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] + public void YieldSingle_ExpectCollectionLengthEqualsOne( + object? sourceValue) { - [Test] - [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] - public void YieldSingle_ExpectCollectionLengthEqualsOne( - object? sourceValue) - { - var actual = sourceValue.YieldSingle(); + var actual = sourceValue.YieldSingle(); - var actualLength = actual.Count(); - Assert.AreEqual(1, actualLength); - } + var actualLength = actual.Count(); + Assert.AreEqual(1, actualLength); + } - [Test] - [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] - public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( - object? sourceValue) - { - var actual = sourceValue.YieldSingle(); + [Test] + [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] + public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( + object? sourceValue) + { + var actual = sourceValue.YieldSingle(); - var actualFirst = actual.FirstOrDefault(); - Assert.AreSame(sourceValue, actualFirst); - } + var actualFirst = actual.FirstOrDefault(); + Assert.AreSame(sourceValue, actualFirst); } } diff --git a/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.cs b/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.cs index 6601fb0..ced3667 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YieldExtensionsTest/YieldExtensionsTest.cs @@ -1,8 +1,7 @@ #nullable enable -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class YieldExtensionsTest { - public sealed partial class YieldExtensionsTest - { - } } 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 cd00947..54d2542 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Empty.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Empty.cs @@ -4,15 +4,14 @@ using PrimeFuncPack.UnitTest; using System.Linq; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class YielderTest { - partial class YielderTest + [Test] + public void YieldEmpty_ExpectEmptyCollection() { - [Test] - public void YieldEmpty_ExpectEmptyCollection() - { - var actual = Yielder.YieldEmpty(); - Assert.IsEmpty(actual); - } + var actual = Yielder.YieldEmpty(); + Assert.IsEmpty(actual); } } 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 e23bf63..c252038 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Single.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.Single.cs @@ -3,30 +3,29 @@ using NUnit.Framework; using System.Linq; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class YielderTest { - partial class YielderTest + [Test] + [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] + public void YieldSingle_ExpectCollectionLengthEqualsOne( + object? sourceValue) { - [Test] - [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] - public void YieldSingle_ExpectCollectionLengthEqualsOne( - object? sourceValue) - { - var actual = Yielder.YieldSingle(sourceValue); + var actual = Yielder.YieldSingle(sourceValue); - var actualLength = actual.Count(); - Assert.AreEqual(1, actualLength); - } + var actualLength = actual.Count(); + Assert.AreEqual(1, actualLength); + } - [Test] - [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] - public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( - object? sourceValue) - { - var actual = Yielder.YieldSingle(sourceValue); + [Test] + [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] + public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( + object? sourceValue) + { + var actual = Yielder.YieldSingle(sourceValue); - var actualFirst = actual.FirstOrDefault(); - Assert.AreSame(sourceValue, actualFirst); - } + var actualFirst = actual.FirstOrDefault(); + Assert.AreSame(sourceValue, actualFirst); } } diff --git a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.cs b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.cs index b57d1e3..a34a925 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTest/YielderTest.cs @@ -1,8 +1,7 @@ #nullable enable -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class YielderTest { - public sealed partial class YielderTest - { - } } 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 67260ac..8a8f837 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Empty.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Empty.cs @@ -4,15 +4,14 @@ using PrimeFuncPack.UnitTest; using System.Linq; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class YielderTypedTest { - partial class YielderTypedTest + [Test] + public void YieldEmpty_ExpectEmptyCollection() { - [Test] - public void YieldEmpty_ExpectEmptyCollection() - { - var actual = Yielder.YieldEmpty(); - Assert.IsEmpty(actual); - } + var actual = Yielder.YieldEmpty(); + Assert.IsEmpty(actual); } } 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 4266fc4..749314d 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Single.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.Single.cs @@ -3,30 +3,29 @@ using NUnit.Framework; using System.Linq; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class YielderTypedTest { - partial class YielderTypedTest + [Test] + [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] + public void YieldSingle_ExpectCollectionLengthEqualsOne( + object? sourceValue) { - [Test] - [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] - public void YieldSingle_ExpectCollectionLengthEqualsOne( - object? sourceValue) - { - var actual = Yielder.YieldSingle(sourceValue); + var actual = Yielder.YieldSingle(sourceValue); - var actualLength = actual.Count(); - Assert.AreEqual(1, actualLength); - } + var actualLength = actual.Count(); + Assert.AreEqual(1, actualLength); + } - [Test] - [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] - public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( - object? sourceValue) - { - var actual = Yielder.YieldSingle(sourceValue); + [Test] + [TestCaseSource(typeof(ObjectTestData), nameof(ObjectTestData.NullableObjectTestSource))] + public void YieldSingle_ExpectFirstItemIsSameAsSourceValue( + object? sourceValue) + { + var actual = Yielder.YieldSingle(sourceValue); - var actualFirst = actual.FirstOrDefault(); - Assert.AreSame(sourceValue, actualFirst); - } + var actualFirst = actual.FirstOrDefault(); + Assert.AreSame(sourceValue, actualFirst); } } diff --git a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.cs b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.cs index 570d405..4dd28f1 100644 --- a/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.cs +++ b/src/primitives-linq/Primitives.Linq.Tests/YielderTypedTest/YielderTypedTest.cs @@ -1,8 +1,7 @@ #nullable enable -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class YielderTypedTest { - public sealed partial class YielderTypedTest - { - } } diff --git a/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj b/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj index 80c610d..ff28f55 100644 --- a/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj +++ b/src/primitives-linq/Primitives.Linq/Primitives.Linq.csproj @@ -8,12 +8,16 @@ true true LICENSE + README.md + https://github.com/pfpack/pfpack-primitives + https://github.com/pfpack/pfpack-primitives + pfpack Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2021 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Primitives.Linq is a core library for .NET consisting of useful extensions making work with Linq easier. System PrimeFuncPack.Primitives.Linq - 2.0.0-preview.2.0.0 + 2.0.0-preview.2.0.1 @@ -21,6 +25,10 @@ True + + True + + diff --git a/src/primitives-linq/Primitives.Linq/YieldExtensions.cs b/src/primitives-linq/Primitives.Linq/YieldExtensions.cs index b9385e9..36b9ad8 100644 --- a/src/primitives-linq/Primitives.Linq/YieldExtensions.cs +++ b/src/primitives-linq/Primitives.Linq/YieldExtensions.cs @@ -3,13 +3,12 @@ using System.Collections.Generic; using System.Runtime.CompilerServices; -namespace System.Linq +namespace System.Linq; + +public static class YieldExtensions { - public static class YieldExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static IEnumerable YieldSingle(this T value) - => - Yielder.YieldSingle(value); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static IEnumerable YieldSingle(this T value) + => + Yielder.YieldSingle(value); } diff --git a/src/primitives-linq/Primitives.Linq/Yielder.T.cs b/src/primitives-linq/Primitives.Linq/Yielder.T.cs index d8c4bdf..64da11e 100644 --- a/src/primitives-linq/Primitives.Linq/Yielder.T.cs +++ b/src/primitives-linq/Primitives.Linq/Yielder.T.cs @@ -2,18 +2,17 @@ using System.Collections.Generic; -namespace System.Linq +namespace System.Linq; + +public static class Yielder { - public static class Yielder + public static IEnumerable YieldSingle(T value) { - public static IEnumerable YieldSingle(T value) - { - yield return value; - } + yield return value; + } - public static IEnumerable YieldEmpty() - { - yield break; - } + public static IEnumerable YieldEmpty() + { + yield break; } } diff --git a/src/primitives-linq/Primitives.Linq/Yielder.cs b/src/primitives-linq/Primitives.Linq/Yielder.cs index bc71dd1..bc14c2b 100644 --- a/src/primitives-linq/Primitives.Linq/Yielder.cs +++ b/src/primitives-linq/Primitives.Linq/Yielder.cs @@ -2,18 +2,17 @@ using System.Collections.Generic; -namespace System.Linq +namespace System.Linq; + +public static class Yielder { - public static class Yielder + public static IEnumerable YieldSingle(T value) { - public static IEnumerable YieldSingle(T value) - { - yield return value; - } + yield return value; + } - public static IEnumerable YieldEmpty() - { - yield break; - } + public static IEnumerable YieldEmpty() + { + yield break; } } 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 4ecfbd6..f716283 100644 --- a/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs +++ b/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Pipe.cs @@ -3,17 +3,16 @@ using NUnit.Framework; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PipelineTests { - partial class PipelineTests + [Test] + [TestCaseSource(nameof(ValueTestSource))] + public void Pipe_ExpectSourceValue( + object? sourceValue) { - [Test] - [TestCaseSource(nameof(ValueTestSource))] - public void Pipe_ExpectSourceValue( - object? sourceValue) - { - var actual = Pipeline.Pipe(sourceValue); - Assert.AreSame(sourceValue, actual); - } + var actual = Pipeline.Pipe(sourceValue); + Assert.AreSame(sourceValue, actual); } } diff --git a/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Tests.cs b/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Tests.cs index 48ddae3..e6ba452 100644 --- a/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Tests.cs +++ b/src/primitives-pipeline/Primitives.Pipeline.Tests/Pipeline.Tests/Tests.cs @@ -4,25 +4,24 @@ using System.Collections.Generic; using System.Linq; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class PipelineTests { - public sealed partial class PipelineTests - { - private static IEnumerable ValueTestSource - => - SourceValues.Select(v => new object?[] { v }); + private static IEnumerable ValueTestSource + => + SourceValues.Select(v => new object?[] { v }); - private static IReadOnlyCollection SourceValues - => - new object?[] - { - null, - "Some String", - string.Empty, - new DateTime(2020, 09, 25), - (int?)15, - new object(), - new { Id = 1, Text = "Some Text" } - }; - } + private static IReadOnlyCollection SourceValues + => + new object?[] + { + null, + "Some String", + string.Empty, + new DateTime(2020, 09, 25), + (int?)15, + new object(), + new { Id = 1, Text = "Some Text" } + }; } 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 4568880..db0585f 100644 --- a/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Pipe.cs +++ b/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Pipe.cs @@ -4,19 +4,18 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PipelineExtensionsTests { - partial class PipelineExtensionsTests + [Test] + [TestCaseSource(nameof(ValueTestSource))] + public void Pipe_ExpectMappedSourceValue( + object? sourceValue) { - [Test] - [TestCaseSource(nameof(ValueTestSource))] - public void Pipe_ExpectMappedSourceValue( - object? sourceValue) - { - var actual = sourceValue.Pipe(value => (value, PlusFifteen)); - var expected = (sourceValue, PlusFifteen); - Assert.AreSame(expected.sourceValue, sourceValue); - Assert.AreEqual(expected, actual); - } + var actual = sourceValue.Pipe(value => (value, PlusFifteen)); + var expected = (sourceValue, PlusFifteen); + Assert.AreSame(expected.sourceValue, sourceValue); + Assert.AreEqual(expected, actual); } } diff --git a/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Tests.cs b/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Tests.cs index 2e94aa3..9334a70 100644 --- a/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Tests.cs +++ b/src/primitives-pipeline/Primitives.Pipeline.Tests/PipelineExtensions.Tests/Tests.cs @@ -4,25 +4,24 @@ using System.Collections.Generic; using System.Linq; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class PipelineExtensionsTests { - public sealed partial class PipelineExtensionsTests - { - private static IEnumerable ValueTestSource - => - SourceValues.Select(v => new object?[] { v }); + private static IEnumerable ValueTestSource + => + SourceValues.Select(v => new object?[] { v }); - private static IReadOnlyCollection SourceValues - => - new object?[] - { - null, - "Some String", - string.Empty, - new DateTime(2020, 09, 25), - (int?)15, - new object(), - new { Id = 1, Text = "Some Text" } - }; - } + private static IReadOnlyCollection SourceValues + => + new object?[] + { + null, + "Some String", + string.Empty, + new DateTime(2020, 09, 25), + (int?)15, + new object(), + new { Id = 1, Text = "Some Text" } + }; } diff --git a/src/primitives-pipeline/Primitives.Pipeline/Pipeline.cs b/src/primitives-pipeline/Primitives.Pipeline/Pipeline.cs index 68cb75b..4df41ec 100644 --- a/src/primitives-pipeline/Primitives.Pipeline/Pipeline.cs +++ b/src/primitives-pipeline/Primitives.Pipeline/Pipeline.cs @@ -2,11 +2,10 @@ using System.Runtime.CompilerServices; -namespace System +namespace System; + +public static class Pipeline { - public static class Pipeline - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static T Pipe(T value) => value; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static T Pipe(T value) => value; } diff --git a/src/primitives-pipeline/Primitives.Pipeline/PipelineExtensions.cs b/src/primitives-pipeline/Primitives.Pipeline/PipelineExtensions.cs index 8a95d81..1a91d28 100644 --- a/src/primitives-pipeline/Primitives.Pipeline/PipelineExtensions.cs +++ b/src/primitives-pipeline/Primitives.Pipeline/PipelineExtensions.cs @@ -2,16 +2,15 @@ using System.Runtime.CompilerServices; -namespace System +namespace System; + +public static class PipelineExtensions { - public static class PipelineExtensions + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static TResult Pipe(this T value, Func pipe) { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static TResult Pipe(this T value, Func pipe) - { - _ = pipe ?? throw new ArgumentNullException(nameof(pipe)); + _ = pipe ?? throw new ArgumentNullException(nameof(pipe)); - return pipe.Invoke(value); - } + return pipe.Invoke(value); } } diff --git a/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj b/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj index 377d5a0..fd5958c 100644 --- a/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj +++ b/src/primitives-pipeline/Primitives.Pipeline/Primitives.Pipeline.csproj @@ -8,12 +8,16 @@ true true LICENSE + README.md + https://github.com/pfpack/pfpack-primitives + https://github.com/pfpack/pfpack-primitives + pfpack Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2021 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Primitives.Pipeline is a core library for .NET consisting of useful extensions making work with functional pipelines easier. System PrimeFuncPack.Primitives.Pipeline - 2.0.0-preview.2.0.0 + 2.0.0-preview.2.0.1 @@ -21,6 +25,10 @@ True + + True + + 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 065f593..0b44746 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrEmpty.cs @@ -4,37 +4,36 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNotNullOrEmpty_SourceIsNull_ExpectFalse() { - [Test] - public void IsNotNullOrEmpty_SourceIsNull_ExpectFalse() - { - string? source = null; + string? source = null; - var actual = source.IsNotNullOrEmpty(); - Assert.False(actual); - } + var actual = source.IsNotNullOrEmpty(); + Assert.False(actual); + } - [Test] - public void IsNotNullOrEmpty_SourceIsEmpty_ExpectFalse() - { - string source = string.Empty; + [Test] + public void IsNotNullOrEmpty_SourceIsEmpty_ExpectFalse() + { + string source = string.Empty; - var actual = source.IsNotNullOrEmpty(); - Assert.False(actual); - } + var actual = source.IsNotNullOrEmpty(); + Assert.False(actual); + } - [Test] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void IsNotNullOrEmpty_SourceIsNotEmpty_ExpectTrue( - string source) - { - var actual = source.IsNotNullOrEmpty(); - Assert.True(actual); - } + [Test] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void IsNotNullOrEmpty_SourceIsNotEmpty_ExpectTrue( + string source) + { + var actual = source.IsNotNullOrEmpty(); + Assert.True(actual); } } 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 efab0a6..ac73769 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNotNullOrWhiteSpace.cs @@ -4,46 +4,45 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNotNullOrWhiteSpace_SourceIsNull_ExpectFalse() { - [Test] - public void IsNotNullOrWhiteSpace_SourceIsNull_ExpectFalse() - { - string? source = null; - - var actual = source.IsNotNullOrWhiteSpace(); - Assert.False(actual); - } - - [Test] - public void IsNotNullOrWhiteSpace_SourceIsEmpty_ExpectFalse() - { - string source = string.Empty; - - var actual = source.IsNotNullOrWhiteSpace(); - Assert.False(actual); - } - - [Test] - [TestCase(WhiteSpaceString)] - [TestCase(ThreeWhiteSpacesString)] - [TestCase(TabString)] - public void IsNotNullOrWhiteSpace_SourceIsWhiteSpace_ExpectFalse( - string source) - { - var actual = source.IsNotNullOrWhiteSpace(); - Assert.False(actual); - } - - [Test] - public void IsNotNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectTrue() - { - var source = SomeString; - - var actual = source.IsNotNullOrWhiteSpace(); - Assert.True(actual); - } + string? source = null; + + var actual = source.IsNotNullOrWhiteSpace(); + Assert.False(actual); + } + + [Test] + public void IsNotNullOrWhiteSpace_SourceIsEmpty_ExpectFalse() + { + string source = string.Empty; + + var actual = source.IsNotNullOrWhiteSpace(); + Assert.False(actual); + } + + [Test] + [TestCase(WhiteSpaceString)] + [TestCase(ThreeWhiteSpacesString)] + [TestCase(TabString)] + public void IsNotNullOrWhiteSpace_SourceIsWhiteSpace_ExpectFalse( + string source) + { + var actual = source.IsNotNullOrWhiteSpace(); + Assert.False(actual); + } + + [Test] + public void IsNotNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectTrue() + { + var source = SomeString; + + var actual = source.IsNotNullOrWhiteSpace(); + Assert.True(actual); } } 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 e27b3b8..5da9dea 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 @@ -4,20 +4,19 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNotNull_AnonymousValueIsNotNull_ExpectTrue() { - [Test] - public void IsNotNull_AnonymousValueIsNotNull_ExpectTrue() + var source = new { - var source = new - { - Text = SomeTextStructType - }; + Text = SomeTextStructType + }; - var actual = source.IsNotNull(); - Assert.True(actual); - } + var actual = source.IsNotNull(); + Assert.True(actual); } } 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 ca04730..ee2d8ec 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 @@ -3,18 +3,17 @@ using NUnit.Framework; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + // Test both zero and non-zero values + [Test] + [TestCase(0)] + [TestCase(1)] + public void IsNotNull_NonnullableStruct_ExpectTrue(int source) { - // Test both zero and non-zero values - [Test] - [TestCase(0)] - [TestCase(1)] - public void IsNotNull_NonnullableStruct_ExpectTrue(int source) - { - var actual = source.IsNotNull(); - Assert.True(actual); - } + var actual = source.IsNotNull(); + Assert.True(actual); } } 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 9e5ade3..207b103 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 @@ -3,46 +3,45 @@ using NUnit.Framework; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNotNull_NullableStructIsNull_CallStructOverload_ExpectFalse() + { + int? source = null; + + var actual = source.IsNotNull(); + Assert.False(actual); + } + + [Test] + public void IsNotNull_NullableStructIsNull_CallObjectOverload_ExpectFalse() + { + int? source = null; + + var actual = source.IsNotNull(); + Assert.False(actual); + } + + // Test both zero and non-zero values + [Test] + [TestCase(0)] + [TestCase(1)] + public void IsNotNull_NullableStructIsNotNull_CallStructOverload_ExpectTrue(int? source) + { + var actual = source.IsNotNull(); + Assert.True(actual); + } + + // Test both zero and non-zero values + [Test] + [TestCase(0)] + [TestCase(1)] + public void IsNotNull_NullableStructIsNotNull_CallObjectOverload_ExpectTrue(int? source) { - [Test] - public void IsNotNull_NullableStructIsNull_CallStructOverload_ExpectFalse() - { - int? source = null; - - var actual = source.IsNotNull(); - Assert.False(actual); - } - - [Test] - public void IsNotNull_NullableStructIsNull_CallObjectOverload_ExpectFalse() - { - int? source = null; - - var actual = source.IsNotNull(); - Assert.False(actual); - } - - // Test both zero and non-zero values - [Test] - [TestCase(0)] - [TestCase(1)] - public void IsNotNull_NullableStructIsNotNull_CallStructOverload_ExpectTrue(int? source) - { - var actual = source.IsNotNull(); - Assert.True(actual); - } - - // Test both zero and non-zero values - [Test] - [TestCase(0)] - [TestCase(1)] - public void IsNotNull_NullableStructIsNotNull_CallObjectOverload_ExpectTrue(int? source) - { - var actual = source.IsNotNull(); - Assert.True(actual); - } + var actual = source.IsNotNull(); + Assert.True(actual); } } 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 aff893d..5a092ba 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 @@ -5,26 +5,25 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNotNull_RefValueIsNull_ExpectFalse() { - [Test] - public void IsNotNull_RefValueIsNull_ExpectFalse() - { - RefType source = null!; + RefType source = null!; - var actual = source.IsNotNull(); - Assert.False(actual); - } + var actual = source.IsNotNull(); + Assert.False(actual); + } - [Test] - public void IsNotNull_RefValueIsNotNull_ExpectTrue() - { - var source = MinusFifteenIdRefType; + [Test] + public void IsNotNull_RefValueIsNotNull_ExpectTrue() + { + var source = MinusFifteenIdRefType; - var actual = source.IsNotNull(); - Assert.True(actual); - } + var actual = source.IsNotNull(); + Assert.True(actual); } } 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 5143fe9..ac606cb 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 @@ -4,28 +4,27 @@ using PrimeFuncPack.UnitTest; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class PredicateExtensionsTests { - public sealed partial class PredicateExtensionsTests + [Test] + public void IsNotNull_StringIsNull_ExpectFalse() { - [Test] - public void IsNotNull_StringIsNull_ExpectFalse() - { - string source = null!; + string source = null!; - var actual = source.IsNotNull(); - Assert.False(actual); - } + var actual = source.IsNotNull(); + Assert.False(actual); + } - [Test] - [TestCase(TestData.EmptyString)] - [TestCase(TestData.WhiteSpaceString)] - [TestCase(TestData.TabString)] - [TestCase(TestData.SomeString)] - public void IsNotNull_StringIsNotNull_ExpectTrue(string? source) - { - var actual = source.IsNotNull(); - Assert.True(actual); - } + [Test] + [TestCase(TestData.EmptyString)] + [TestCase(TestData.WhiteSpaceString)] + [TestCase(TestData.TabString)] + [TestCase(TestData.SomeString)] + public void IsNotNull_StringIsNotNull_ExpectTrue(string? source) + { + var actual = source.IsNotNull(); + Assert.True(actual); } } 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 9e74c3f..74cf3c5 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrEmpty.cs @@ -4,37 +4,36 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNullOrEmpty_SourceIsNull_ExpectTrue() { - [Test] - public void IsNullOrEmpty_SourceIsNull_ExpectTrue() - { - string? source = null; + string? source = null; - var actual = source.IsNullOrEmpty(); - Assert.True(actual); - } + var actual = source.IsNullOrEmpty(); + Assert.True(actual); + } - [Test] - public void IsNullOrEmpty_SourceIsEmpty_ExpectTrue() - { - string source = string.Empty; + [Test] + public void IsNullOrEmpty_SourceIsEmpty_ExpectTrue() + { + string source = string.Empty; - var actual = source.IsNullOrEmpty(); - Assert.True(actual); - } + var actual = source.IsNullOrEmpty(); + Assert.True(actual); + } - [Test] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void IsNullOrEmpty_SourceIsNotEmpty_ExpectFalse( - string source) - { - var actual = source.IsNullOrEmpty(); - Assert.False(actual); - } + [Test] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void IsNullOrEmpty_SourceIsNotEmpty_ExpectFalse( + string source) + { + var actual = source.IsNullOrEmpty(); + Assert.False(actual); } } 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 e58a874..4f3cae4 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/IsNullOrWhiteSpace.cs @@ -4,46 +4,45 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNullOrWhiteSpace_SourceIsNull_ExpectTrue() { - [Test] - public void IsNullOrWhiteSpace_SourceIsNull_ExpectTrue() - { - string? source = null; - - var actual = source.IsNullOrWhiteSpace(); - Assert.True(actual); - } - - [Test] - public void IsNullOrWhiteSpace_SourceIsEmpty_ExpectTrue() - { - string source = string.Empty; - - var actual = source.IsNullOrWhiteSpace(); - Assert.True(actual); - } - - [Test] - [TestCase(WhiteSpaceString)] - [TestCase(ThreeWhiteSpacesString)] - [TestCase(TabString)] - public void IsNullOrWhiteSpace_SourceIsWhiteSpace_ExpectTrue( - string source) - { - var actual = source.IsNullOrWhiteSpace(); - Assert.True(actual); - } - - [Test] - public void IsNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectFalse() - { - var source = SomeString; - - var actual = source.IsNullOrWhiteSpace(); - Assert.False(actual); - } + string? source = null; + + var actual = source.IsNullOrWhiteSpace(); + Assert.True(actual); + } + + [Test] + public void IsNullOrWhiteSpace_SourceIsEmpty_ExpectTrue() + { + string source = string.Empty; + + var actual = source.IsNullOrWhiteSpace(); + Assert.True(actual); + } + + [Test] + [TestCase(WhiteSpaceString)] + [TestCase(ThreeWhiteSpacesString)] + [TestCase(TabString)] + public void IsNullOrWhiteSpace_SourceIsWhiteSpace_ExpectTrue( + string source) + { + var actual = source.IsNullOrWhiteSpace(); + Assert.True(actual); + } + + [Test] + public void IsNullOrWhiteSpace_SourceIsNotWhiteSpace_ExpectFalse() + { + var source = SomeString; + + var actual = source.IsNullOrWhiteSpace(); + Assert.False(actual); } } 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 5c064fb..c15d238 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 @@ -4,20 +4,19 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNull_AnonymousValueIsNotNull_ExpectFalse() { - [Test] - public void IsNull_AnonymousValueIsNotNull_ExpectFalse() + var source = new { - var source = new - { - Text = SomeTextStructType - }; + Text = SomeTextStructType + }; - var actual = source.IsNull(); - Assert.False(actual); - } + var actual = source.IsNull(); + Assert.False(actual); } } 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 6429695..bf0672d 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 @@ -3,18 +3,17 @@ using NUnit.Framework; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + // Test both zero and non-zero values + [Test] + [TestCase(0)] + [TestCase(1)] + public void IsNull_NonnullableStruct_ExpectFalse(int source) { - // Test both zero and non-zero values - [Test] - [TestCase(0)] - [TestCase(1)] - public void IsNull_NonnullableStruct_ExpectFalse(int source) - { - var actual = source.IsNull(); - Assert.False(actual); - } + var actual = source.IsNull(); + Assert.False(actual); } } 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 3518817..8be4d54 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 @@ -3,46 +3,45 @@ using NUnit.Framework; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNull_NullableStructIsNull_CallStructOverload_ExpectTrue() + { + int? source = null; + + var actual = source.IsNull(); + Assert.True(actual); + } + + [Test] + public void IsNull_NullableStructIsNull_CallObjectOverload_ExpectTrue() + { + int? source = null; + + var actual = source.IsNull(); + Assert.True(actual); + } + + // Test both zero and non-zero values + [Test] + [TestCase(0)] + [TestCase(1)] + public void IsNull_NullableStructIsNotNull_CallStructOverload_ExpectFalse(int? source) + { + var actual = source.IsNull(); + Assert.False(actual); + } + + // Test both zero and non-zero values + [Test] + [TestCase(0)] + [TestCase(1)] + public void IsNull_NullableStructIsNotNull_CallObjectOverload_ExpectFalse(int? source) { - [Test] - public void IsNull_NullableStructIsNull_CallStructOverload_ExpectTrue() - { - int? source = null; - - var actual = source.IsNull(); - Assert.True(actual); - } - - [Test] - public void IsNull_NullableStructIsNull_CallObjectOverload_ExpectTrue() - { - int? source = null; - - var actual = source.IsNull(); - Assert.True(actual); - } - - // Test both zero and non-zero values - [Test] - [TestCase(0)] - [TestCase(1)] - public void IsNull_NullableStructIsNotNull_CallStructOverload_ExpectFalse(int? source) - { - var actual = source.IsNull(); - Assert.False(actual); - } - - // Test both zero and non-zero values - [Test] - [TestCase(0)] - [TestCase(1)] - public void IsNull_NullableStructIsNotNull_CallObjectOverload_ExpectFalse(int? source) - { - var actual = source.IsNull(); - Assert.False(actual); - } + var actual = source.IsNull(); + Assert.False(actual); } } 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 b7c002b..faa9dbf 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 @@ -4,26 +4,25 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class PredicateExtensionsTests { - partial class PredicateExtensionsTests + [Test] + public void IsNull_RefValueIsNull_ExpectTrue() { - [Test] - public void IsNull_RefValueIsNull_ExpectTrue() - { - object source = null!; + object source = null!; - var actual = source.IsNull(); - Assert.True(actual); - } + var actual = source.IsNull(); + Assert.True(actual); + } - [Test] - public void IsNull_RefValueIsNotNull_ExpectFalse() - { - var source = ZeroIdRefType; + [Test] + public void IsNull_RefValueIsNotNull_ExpectFalse() + { + var source = ZeroIdRefType; - var actual = source.IsNull(); - Assert.False(actual); - } + var actual = source.IsNull(); + Assert.False(actual); } } 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 f1f783f..933fff3 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 @@ -4,28 +4,27 @@ using PrimeFuncPack.UnitTest; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class PredicateExtensionsTests { - public sealed partial class PredicateExtensionsTests + [Test] + public void IsNull_StringIsNull_ExpectTrue() { - [Test] - public void IsNull_StringIsNull_ExpectTrue() - { - string source = null!; + string source = null!; - var actual = source.IsNull(); - Assert.True(actual); - } + var actual = source.IsNull(); + Assert.True(actual); + } - [Test] - [TestCase(TestData.EmptyString)] - [TestCase(TestData.WhiteSpaceString)] - [TestCase(TestData.TabString)] - [TestCase(TestData.SomeString)] - public void IsNull_StringIsNotNull_ExpectFalse(string? source) - { - var actual = source.IsNull(); - Assert.False(actual); - } + [Test] + [TestCase(TestData.EmptyString)] + [TestCase(TestData.WhiteSpaceString)] + [TestCase(TestData.TabString)] + [TestCase(TestData.SomeString)] + public void IsNull_StringIsNotNull_ExpectFalse(string? source) + { + var actual = source.IsNull(); + Assert.False(actual); } } diff --git a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/Tests.cs b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/Tests.cs index 82f1b59..b90daf6 100644 --- a/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/Tests.cs +++ b/src/primitives-predicates/Primitives.Predicates.Tests/PredicateExtensions.Tests/Tests.cs @@ -1,8 +1,7 @@ #nullable enable -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class PredicateExtensionsTests { - public sealed partial class PredicateExtensionsTests - { - } } diff --git a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.Struct.cs b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.Struct.cs index 0766d92..22718e8 100644 --- a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.Struct.cs +++ b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.Struct.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class PredicateExtensions { - partial class PredicateExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNull([NotNullWhen(true)] this T? value) where T : struct - => - value is not null; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNull([NotNullWhen(true)] this T? value) where T : struct + => + value is not null; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNull([NotNullWhen(false)] this T? value) where T : struct - => - value is null; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNull([NotNullWhen(false)] this T? value) where T : struct + => + value is null; } diff --git a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.cs b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.cs index c23efd2..bd2f767 100644 --- a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.cs +++ b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.Null.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class PredicateExtensions { - partial class PredicateExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNull([NotNullWhen(true)][MaybeNullWhen(false)] this T? value) - => - value is not null; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNull([NotNullWhen(true)][MaybeNullWhen(false)] this T? value) + => + value is not null; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNull([NotNullWhen(false)][MaybeNullWhen(true)] this T? value) - => - value is null; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNull([NotNullWhen(false)][MaybeNullWhen(true)] this T? value) + => + value is null; } diff --git a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrEmpty.cs b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrEmpty.cs index 09657cd..7951ee6 100644 --- a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrEmpty.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class PredicateExtensions { - partial class PredicateExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNullOrEmpty([NotNullWhen(true)][MaybeNullWhen(false)] this string? value) - => - string.IsNullOrEmpty(value) is false; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNullOrEmpty([NotNullWhen(true)][MaybeNullWhen(false)] this string? value) + => + string.IsNullOrEmpty(value) is false; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNullOrEmpty([NotNullWhen(false)][MaybeNullWhen(true)] this string? value) - => - string.IsNullOrEmpty(value); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNullOrEmpty([NotNullWhen(false)][MaybeNullWhen(true)] this string? value) + => + string.IsNullOrEmpty(value); } diff --git a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrWhiteSpace.cs b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrWhiteSpace.cs index d4e1e02..8da7a22 100644 --- a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.NullOrWhiteSpace.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class PredicateExtensions { - partial class PredicateExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNullOrWhiteSpace([NotNullWhen(true)][MaybeNullWhen(false)] this string? value) - => - string.IsNullOrWhiteSpace(value) is false; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNullOrWhiteSpace([NotNullWhen(true)][MaybeNullWhen(false)] this string? value) + => + string.IsNullOrWhiteSpace(value) is false; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNullOrWhiteSpace([NotNullWhen(false)][MaybeNullWhen(true)] this string? value) - => - string.IsNullOrWhiteSpace(value); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNullOrWhiteSpace([NotNullWhen(false)][MaybeNullWhen(true)] this string? value) + => + string.IsNullOrWhiteSpace(value); } diff --git a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.cs b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.cs index 08c7edf..15e6f92 100644 --- a/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.cs +++ b/src/primitives-predicates/Primitives.Predicates/PredicateExtensions/PredicateExtensions.cs @@ -1,8 +1,7 @@ #nullable enable -namespace System +namespace System; + +public static partial class PredicateExtensions { - public static partial class PredicateExtensions - { - } } diff --git a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.Struct.cs b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.Struct.cs index 2636042..72dbea8 100644 --- a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.Struct.cs +++ b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.Struct.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class Predicates { - partial class Predicates - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNull([NotNullWhen(true)] T? value) where T : struct - => - value is not null; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNull([NotNullWhen(true)] T? value) where T : struct + => + value is not null; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNull([NotNullWhen(false)] T? value) where T : struct - => - value is null; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNull([NotNullWhen(false)] T? value) where T : struct + => + value is null; } diff --git a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.cs b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.cs index a312cff..ef97378 100644 --- a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.cs +++ b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.Null.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class Predicates { - partial class Predicates - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNull([NotNullWhen(true)][MaybeNullWhen(false)] T? value) - => - value is not null; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNull([NotNullWhen(true)][MaybeNullWhen(false)] T? value) + => + value is not null; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNull([NotNullWhen(false)][MaybeNullWhen(true)] T? value) - => - value is null; - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNull([NotNullWhen(false)][MaybeNullWhen(true)] T? value) + => + value is null; } diff --git a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrEmpty.cs b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrEmpty.cs index ecaa1ee..758e144 100644 --- a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrEmpty.cs +++ b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrEmpty.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class Predicates { - partial class Predicates - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNullOrEmpty([NotNullWhen(true)][MaybeNullWhen(false)] string? value) - => - string.IsNullOrEmpty(value) is false; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNullOrEmpty([NotNullWhen(true)][MaybeNullWhen(false)] string? value) + => + string.IsNullOrEmpty(value) is false; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNullOrEmpty([NotNullWhen(false)][MaybeNullWhen(true)] string? value) - => - string.IsNullOrEmpty(value); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNullOrEmpty([NotNullWhen(false)][MaybeNullWhen(true)] string? value) + => + string.IsNullOrEmpty(value); } diff --git a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrWhiteSpace.cs b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrWhiteSpace.cs index 1f66438..035ef59 100644 --- a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrWhiteSpace.cs +++ b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.NullOrWhiteSpace.cs @@ -3,18 +3,17 @@ using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; -namespace System +namespace System; + +partial class Predicates { - partial class Predicates - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNotNullOrWhiteSpace([NotNullWhen(true)][MaybeNullWhen(false)] string? value) - => - string.IsNullOrWhiteSpace(value) is false; + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNotNullOrWhiteSpace([NotNullWhen(true)][MaybeNullWhen(false)] string? value) + => + string.IsNullOrWhiteSpace(value) is false; - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsNullOrWhiteSpace([NotNullWhen(false)][MaybeNullWhen(true)] string? value) - => - string.IsNullOrWhiteSpace(value); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static bool IsNullOrWhiteSpace([NotNullWhen(false)][MaybeNullWhen(true)] string? value) + => + string.IsNullOrWhiteSpace(value); } diff --git a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.cs b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.cs index aa979c5..1999549 100644 --- a/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.cs +++ b/src/primitives-predicates/Primitives.Predicates/Predicates/Predicates.cs @@ -1,8 +1,7 @@ #nullable enable -namespace System +namespace System; + +public static partial class Predicates { - public static partial class Predicates - { - } } diff --git a/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj b/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj index 61d1265..ea3e2dd 100644 --- a/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj +++ b/src/primitives-predicates/Primitives.Predicates/Primitives.Predicates.csproj @@ -8,12 +8,16 @@ true true LICENSE + README.md + https://github.com/pfpack/pfpack-primitives + https://github.com/pfpack/pfpack-primitives + pfpack Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2021 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Primitives.Predicates is a core library for .NET consisting of useful extensions and predicates making work with the nullable feature easier. System PrimeFuncPack.Primitives.Predicates - 2.0.0-preview.2.0.0 + 2.0.0-preview.2.0.1 @@ -21,6 +25,10 @@ True + + True + + 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 7734cfe..6a114d4 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrEmpty.cs @@ -4,29 +4,28 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringExtensionsTests { - partial class StringExtensionsTests + [Test] + public void OrEmpty_SourceIsNull_ExpectEmpty() { - [Test] - public void OrEmpty_SourceIsNull_ExpectEmpty() - { - string? source = null; + string? source = null; - var actual = source.OrEmpty(); - Assert.IsEmpty(actual); - } + var actual = source.OrEmpty(); + Assert.IsEmpty(actual); + } - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void OrEmpty_SourceIsNotNull_ExpectSourceValue( - string source) - { - var actual = source.OrEmpty(); - Assert.AreSame(source, actual); - } + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void OrEmpty_SourceIsNotNull_ExpectSourceValue( + string source) + { + var actual = source.OrEmpty(); + Assert.AreSame(source, actual); } } 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 2da816b..6ca00b8 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfEmpty.cs @@ -4,29 +4,28 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringExtensionsTests { - partial class StringExtensionsTests + [Test] + public void OrNullIfEmpty_SourceIsEmpty_ExpectNull() { - [Test] - public void OrNullIfEmpty_SourceIsEmpty_ExpectNull() - { - string? source = string.Empty; + string? source = string.Empty; - var actual = source.OrNullIfEmpty(); - Assert.IsNull(actual); - } + var actual = source.OrNullIfEmpty(); + Assert.IsNull(actual); + } - [Test] - [TestCase(null)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void OrNullIfEmpty_SourceIsNotEmpty_ExpectSourceValue( - string? source) - { - var actual = source.OrNullIfEmpty(); - Assert.AreSame(source, actual); - } + [Test] + [TestCase(null)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void OrNullIfEmpty_SourceIsNotEmpty_ExpectSourceValue( + string? source) + { + var actual = source.OrNullIfEmpty(); + Assert.AreSame(source, actual); } } 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 f88a26d..729bb50 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfWhiteSpace.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/OrNullIfWhiteSpace.cs @@ -4,30 +4,29 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringExtensionsTests { - partial class StringExtensionsTests + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(ThreeWhiteSpacesString)] + [TestCase(TabString)] + public void OrNullIfWhiteSpace_SourceIsWhiteSpace_ExpectNull( + string? source) { - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(ThreeWhiteSpacesString)] - [TestCase(TabString)] - public void OrNullIfWhiteSpace_SourceIsWhiteSpace_ExpectNull( - string? source) - { - var actual = source.OrNullIfWhiteSpace(); - Assert.IsNull(actual); - } + var actual = source.OrNullIfWhiteSpace(); + Assert.IsNull(actual); + } - [Test] - [TestCase(null)] - [TestCase(SomeString)] - public void OrNullIfWhiteSpace_SourceIsNotWhiteSpace_ExpectSourceValue( - string? source) - { - var actual = source.OrNullIfWhiteSpace(); - Assert.AreSame(source, actual); - } + [Test] + [TestCase(null)] + [TestCase(SomeString)] + public void OrNullIfWhiteSpace_SourceIsNotWhiteSpace_ExpectSourceValue( + string? source) + { + var actual = source.OrNullIfWhiteSpace(); + Assert.AreSame(source, actual); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/Tests.cs b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/Tests.cs index 886e099..bc304a7 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/Tests.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/StringExtensions.Tests/Tests.cs @@ -1,8 +1,7 @@ #nullable enable -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class StringExtensionsTests { - public sealed partial class StringExtensionsTests - { - } } 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 884d779..2165c87 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 @@ -4,40 +4,39 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringExtensionsTests { - partial class StringExtensionsTests + [Test] + public void ToStringOrEmpty_Ref_SourceIsNull_ExpectEmpty() + { + ToStringStubRefType? source = null; + + var actual = source.ToStringOrEmpty(); + Assert.IsEmpty(actual); + } + + [Test] + public void ToStringOrEmpty_Ref_SourceToStringIsNull_ExpectEmpty() { - [Test] - public void ToStringOrEmpty_Ref_SourceIsNull_ExpectEmpty() - { - ToStringStubRefType? source = null; - - var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); - } - - [Test] - public void ToStringOrEmpty_Ref_SourceToStringIsNull_ExpectEmpty() - { - ToStringStubRefType? source = new(null); - - var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); - } - - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void ToStringOrEmpty_Ref_SourceToStringIsNotNull_ExpectActualToStringValue( - string sourceToStringValue) - { - ToStringStubRefType? source = new(sourceToStringValue); - - var actual = source.ToStringOrEmpty(); - Assert.AreEqual(sourceToStringValue, actual); - } + ToStringStubRefType? source = new(null); + + var actual = source.ToStringOrEmpty(); + Assert.IsEmpty(actual); + } + + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void ToStringOrEmpty_Ref_SourceToStringIsNotNull_ExpectActualToStringValue( + string sourceToStringValue) + { + ToStringStubRefType? source = new(sourceToStringValue); + + var actual = source.ToStringOrEmpty(); + Assert.AreEqual(sourceToStringValue, actual); } } 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 64e5a35..780e1fe 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 @@ -4,40 +4,39 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringExtensionsTests { - partial class StringExtensionsTests + [Test] + public void ToStringOrEmpty_StructNullable_SourceIsNull_ExpectEmpty() + { + ToStringStubStructType? source = null; + + var actual = source.ToStringOrEmpty(); + Assert.IsEmpty(actual); + } + + [Test] + public void ToStringOrEmpty_StructNullable_SourceToStringIsNull_ExpectEmpty() { - [Test] - public void ToStringOrEmpty_StructNullable_SourceIsNull_ExpectEmpty() - { - ToStringStubStructType? source = null; - - var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); - } - - [Test] - public void ToStringOrEmpty_StructNullable_SourceToStringIsNull_ExpectEmpty() - { - ToStringStubStructType? source = new(null); - - var actual = source.ToStringOrEmpty(); - Assert.IsEmpty(actual); - } - - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void ToStringOrEmpty_StructNullable_SourceToStringIsNotNull_ExpectActualToStringValue( - string sourceToStringValue) - { - ToStringStubStructType? source = new(sourceToStringValue); - - var actual = source.ToStringOrEmpty(); - Assert.AreEqual(sourceToStringValue, actual); - } + ToStringStubStructType? source = new(null); + + var actual = source.ToStringOrEmpty(); + Assert.IsEmpty(actual); + } + + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void ToStringOrEmpty_StructNullable_SourceToStringIsNotNull_ExpectActualToStringValue( + string sourceToStringValue) + { + ToStringStubStructType? source = new(sourceToStringValue); + + var actual = source.ToStringOrEmpty(); + Assert.AreEqual(sourceToStringValue, actual); } } 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 e248405..14c4382 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Empty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Empty.cs @@ -3,22 +3,21 @@ using NUnit.Framework; using System; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringsTests { - partial class StringsTests + [Test] + public void Empty_ExpectEmptyString() { - [Test] - public void Empty_ExpectEmptyString() - { - var actual = Strings.Empty; - Assert.IsEmpty(actual); - } + var actual = Strings.Empty; + Assert.IsEmpty(actual); + } - [Test] - public void GetEmpty_ExpectEmptyString() - { - var actual = Strings.GetEmpty(); - Assert.IsEmpty(actual); - } + [Test] + public void GetEmpty_ExpectEmptyString() + { + var actual = Strings.GetEmpty(); + Assert.IsEmpty(actual); } } 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 7db99e6..cb10f07 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrEmpty.cs @@ -4,29 +4,28 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringsTests { - partial class StringsTests + [Test] + public void OrEmpty_SourceIsNull_ExpectEmpty() { - [Test] - public void OrEmpty_SourceIsNull_ExpectEmpty() - { - string? source = null; + string? source = null; - var actual = Strings.OrEmpty(source); - Assert.IsEmpty(actual); - } + var actual = Strings.OrEmpty(source); + Assert.IsEmpty(actual); + } - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void OrEmpty_SourceIsNotNull_ExpectSourceValue( - string source) - { - var actual = Strings.OrEmpty(source); - Assert.AreSame(source, actual); - } + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void OrEmpty_SourceIsNotNull_ExpectSourceValue( + string source) + { + var actual = Strings.OrEmpty(source); + Assert.AreSame(source, actual); } } 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 95b462c..d90ade9 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfEmpty.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfEmpty.cs @@ -4,29 +4,28 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringsTests { - partial class StringsTests + [Test] + public void OrNullIfEmpty_SourceIsEmpty_ExpectNull() { - [Test] - public void OrNullIfEmpty_SourceIsEmpty_ExpectNull() - { - string? source = string.Empty; + string? source = string.Empty; - var actual = Strings.OrNullIfEmpty(source); - Assert.IsNull(actual); - } + var actual = Strings.OrNullIfEmpty(source); + Assert.IsNull(actual); + } - [Test] - [TestCase(null)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void OrNullIfEmpty_SourceIsNotEmpty_ExpectSourceValue( - string? source) - { - var actual = Strings.OrNullIfEmpty(source); - Assert.AreSame(source, actual); - } + [Test] + [TestCase(null)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void OrNullIfEmpty_SourceIsNotEmpty_ExpectSourceValue( + string? source) + { + var actual = Strings.OrNullIfEmpty(source); + Assert.AreSame(source, actual); } } 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 3489ef0..bed7abf 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfWhiteSpace.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/OrNullIfWhiteSpace.cs @@ -4,30 +4,29 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringsTests { - partial class StringsTests + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(ThreeWhiteSpacesString)] + [TestCase(TabString)] + public void OrNullIfWhiteSpace_SourceIsWhiteSpace_ExpectNull( + string? source) { - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(ThreeWhiteSpacesString)] - [TestCase(TabString)] - public void OrNullIfWhiteSpace_SourceIsWhiteSpace_ExpectNull( - string? source) - { - var actual = Strings.OrNullIfWhiteSpace(source); - Assert.IsNull(actual); - } + var actual = Strings.OrNullIfWhiteSpace(source); + Assert.IsNull(actual); + } - [Test] - [TestCase(null)] - [TestCase(SomeString)] - public void OrNullIfWhiteSpace_SourceIsNotWhiteSpace_ExpectSourceValue( - string? source) - { - var actual = Strings.OrNullIfWhiteSpace(source); - Assert.AreSame(source, actual); - } + [Test] + [TestCase(null)] + [TestCase(SomeString)] + public void OrNullIfWhiteSpace_SourceIsNotWhiteSpace_ExpectSourceValue( + string? source) + { + var actual = Strings.OrNullIfWhiteSpace(source); + Assert.AreSame(source, actual); } } diff --git a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Tests.cs b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Tests.cs index 9645c81..8034442 100644 --- a/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Tests.cs +++ b/src/primitives-strings/Primitives.Strings.Tests/Strings.Tests/Tests.cs @@ -1,8 +1,7 @@ #nullable enable -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +public sealed partial class StringsTests { - public sealed partial class StringsTests - { - } } 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 490c169..92c7d2d 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 @@ -4,40 +4,39 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringsTests { - partial class StringsTests + [Test] + public void ToStringOrEmpty_Ref_SourceIsNull_ExpectEmpty() + { + ToStringStubRefType? source = null; + + var actual = Strings.ToStringOrEmpty(source); + Assert.IsEmpty(actual); + } + + [Test] + public void ToStringOrEmpty_Ref_SourceToStringIsNull_ExpectEmpty() { - [Test] - public void ToStringOrEmpty_Ref_SourceIsNull_ExpectEmpty() - { - ToStringStubRefType? source = null; - - var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); - } - - [Test] - public void ToStringOrEmpty_Ref_SourceToStringIsNull_ExpectEmpty() - { - ToStringStubRefType? source = new(null); - - var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); - } - - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void ToStringOrEmpty_Ref_SourceToStringIsNotNull_ExpectActualToStringValue( - string sourceToStringValue) - { - ToStringStubRefType? source = new(sourceToStringValue); - - var actual = Strings.ToStringOrEmpty(source); - Assert.AreEqual(sourceToStringValue, actual); - } + ToStringStubRefType? source = new(null); + + var actual = Strings.ToStringOrEmpty(source); + Assert.IsEmpty(actual); + } + + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void ToStringOrEmpty_Ref_SourceToStringIsNotNull_ExpectActualToStringValue( + string sourceToStringValue) + { + ToStringStubRefType? source = new(sourceToStringValue); + + var actual = Strings.ToStringOrEmpty(source); + Assert.AreEqual(sourceToStringValue, actual); } } 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 6bef6d5..4225c70 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 @@ -4,40 +4,39 @@ using System; using static PrimeFuncPack.UnitTest.TestData; -namespace PrimeFuncPack.Primitives.Tests +namespace PrimeFuncPack.Primitives.Tests; + +partial class StringsTests { - partial class StringsTests + [Test] + public void ToStringOrEmpty_StructNullable_SourceIsNull_ExpectEmpty() + { + ToStringStubStructType? source = null; + + var actual = Strings.ToStringOrEmpty(source); + Assert.IsEmpty(actual); + } + + [Test] + public void ToStringOrEmpty_StructNullable_SourceToStringIsNull_ExpectEmpty() { - [Test] - public void ToStringOrEmpty_StructNullable_SourceIsNull_ExpectEmpty() - { - ToStringStubStructType? source = null; - - var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); - } - - [Test] - public void ToStringOrEmpty_StructNullable_SourceToStringIsNull_ExpectEmpty() - { - ToStringStubStructType? source = new(null); - - var actual = Strings.ToStringOrEmpty(source); - Assert.IsEmpty(actual); - } - - [Test] - [TestCase(EmptyString)] - [TestCase(WhiteSpaceString)] - [TestCase(TabString)] - [TestCase(SomeString)] - public void ToStringOrEmpty_StructNullable_SourceToStringIsNotNull_ExpectActualToStringValue( - string sourceToStringValue) - { - ToStringStubStructType? source = new(sourceToStringValue); - - var actual = Strings.ToStringOrEmpty(source); - Assert.AreEqual(sourceToStringValue, actual); - } + ToStringStubStructType? source = new(null); + + var actual = Strings.ToStringOrEmpty(source); + Assert.IsEmpty(actual); + } + + [Test] + [TestCase(EmptyString)] + [TestCase(WhiteSpaceString)] + [TestCase(TabString)] + [TestCase(SomeString)] + public void ToStringOrEmpty_StructNullable_SourceToStringIsNotNull_ExpectActualToStringValue( + string sourceToStringValue) + { + ToStringStubStructType? source = new(sourceToStringValue); + + var actual = Strings.ToStringOrEmpty(source); + Assert.AreEqual(sourceToStringValue, actual); } } diff --git a/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj b/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj index 9a353b4..33ce4e2 100644 --- a/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj +++ b/src/primitives-strings/Primitives.Strings/Primitives.Strings.csproj @@ -8,12 +8,16 @@ true true LICENSE + README.md + https://github.com/pfpack/pfpack-primitives + https://github.com/pfpack/pfpack-primitives + pfpack Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2021 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Primitives.Strings is a core library for .NET consisting of useful extensions making work with strings easier. System PrimeFuncPack.Primitives.Strings - 2.0.0-preview.2.0.0 + 2.0.0-preview.2.0.1 @@ -21,6 +25,10 @@ True + + True + + diff --git a/src/primitives-strings/Primitives.Strings/StringExtensions.cs b/src/primitives-strings/Primitives.Strings/StringExtensions.cs index 2171ed7..0cf2ed3 100644 --- a/src/primitives-strings/Primitives.Strings/StringExtensions.cs +++ b/src/primitives-strings/Primitives.Strings/StringExtensions.cs @@ -2,33 +2,32 @@ using System.Runtime.CompilerServices; -namespace System +namespace System; + +public static class StringExtensions { - public static class StringExtensions - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string OrEmpty(this string? value) - => - Strings.OrEmpty(value); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string OrEmpty(this string? value) + => + Strings.OrEmpty(value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string? OrNullIfEmpty(this string? value) - => - Strings.OrNullIfEmpty(value); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string? OrNullIfEmpty(this string? value) + => + Strings.OrNullIfEmpty(value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string? OrNullIfWhiteSpace(this string? value) - => - Strings.OrNullIfWhiteSpace(value); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string? OrNullIfWhiteSpace(this string? value) + => + Strings.OrNullIfWhiteSpace(value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string ToStringOrEmpty(this T? value) - => - Strings.ToStringOrEmpty(value); + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string ToStringOrEmpty(this T? value) + => + Strings.ToStringOrEmpty(value); - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string ToStringOrEmpty(this T? value) where T : struct - => - Strings.ToStringOrEmpty(value); - } + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string ToStringOrEmpty(this T? value) where T : struct + => + Strings.ToStringOrEmpty(value); } diff --git a/src/primitives-strings/Primitives.Strings/Strings.cs b/src/primitives-strings/Primitives.Strings/Strings.cs index 925a178..e694c81 100644 --- a/src/primitives-strings/Primitives.Strings/Strings.cs +++ b/src/primitives-strings/Primitives.Strings/Strings.cs @@ -2,42 +2,41 @@ using System.Runtime.CompilerServices; -namespace System +namespace System; + +public static class Strings { - public static class Strings - { - public const string Empty = ""; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string GetEmpty() => Empty; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string OrEmpty(string? value) - => - value ?? Empty; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string? OrNullIfEmpty(string? value) - => - string.IsNullOrEmpty(value) - ? null - : value; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string? OrNullIfWhiteSpace(string? value) - => - string.IsNullOrWhiteSpace(value) - ? null - : value; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string ToStringOrEmpty(T? value) - => - value?.ToString() ?? Empty; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static string ToStringOrEmpty(T? value) where T : struct - => - value?.ToString() ?? Empty; - } + public const string Empty = ""; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string GetEmpty() => Empty; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string OrEmpty(string? value) + => + value ?? Empty; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string? OrNullIfEmpty(string? value) + => + string.IsNullOrEmpty(value) + ? null + : value; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string? OrNullIfWhiteSpace(string? value) + => + string.IsNullOrWhiteSpace(value) + ? null + : value; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string ToStringOrEmpty(T? value) + => + value?.ToString() ?? Empty; + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static string ToStringOrEmpty(T? value) where T : struct + => + value?.ToString() ?? Empty; } diff --git a/src/primitives/Primitives/Primitives.csproj b/src/primitives/Primitives/Primitives.csproj index d5286c4..0433d38 100644 --- a/src/primitives/Primitives/Primitives.csproj +++ b/src/primitives/Primitives/Primitives.csproj @@ -8,12 +8,16 @@ true true LICENSE + README.md + https://github.com/pfpack/pfpack-primitives + https://github.com/pfpack/pfpack-primitives + pfpack Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2021 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Primitives is a core library for .NET consisting of useful extensions and predicates making work with functional pipelines, Linq, strings, the nullable feature, etc. easier. System PrimeFuncPack.Primitives - 2.0.0-preview.2.0.0 + 2.0.0-preview.2.0.1 @@ -21,13 +25,17 @@ True + + True + + - - - - + + + +