From 8707ec458f3713a3752939dd4140004060b813e0 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 13:57:03 +0400 Subject: [PATCH 01/17] Failure: Setup test project --- .../Failure.Tests/Failure.Tests.csproj | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj index 8522c59e..852172a8 100644 --- a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj +++ b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj @@ -7,6 +7,7 @@ true true false + true Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack.Core.Tests @@ -18,11 +19,11 @@ - + + - - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all From 6ac6607121e515fcea5a580e1da7d446f786733c Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 14:01:04 +0400 Subject: [PATCH 02/17] Failure: Minor refactor: Implement (Inner)MapFailureCode in the same style as WithFailureCode --- .../Failure/Failure.T/T.FailureCode.Map.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core-taggeds-failure/Failure/Failure.T/T.FailureCode.Map.cs b/src/core-taggeds-failure/Failure/Failure.T/T.FailureCode.Map.cs index b82f8737..c725618f 100644 --- a/src/core-taggeds-failure/Failure/Failure.T/T.FailureCode.Map.cs +++ b/src/core-taggeds-failure/Failure/Failure.T/T.FailureCode.Map.cs @@ -17,8 +17,8 @@ private Failure InnerMapFailureCode( where TResultFailureCode : struct => new( - mapFailureCode.Invoke(FailureCode), - failureMessage, // pass the inner state + failureCode: mapFailureCode.Invoke(FailureCode), + failureMessage: failureMessage, default) { SourceException = SourceException From bfcf623c845adb4477edcc7cf9d12910f4d5a382 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 14:26:33 +0400 Subject: [PATCH 03/17] Failure: Multi-target: Use latest lang version --- src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj | 1 + src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs | 2 +- src/core-taggeds-failure/Failure/Failure.csproj | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj index 852172a8..cecd691d 100644 --- a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj +++ b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj @@ -2,6 +2,7 @@ net6.0;net7.0;net8.0 + latest disable enable true diff --git a/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs b/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs index 4585c8e2..ca0b7a08 100644 --- a/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs +++ b/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs @@ -34,5 +34,5 @@ public string FailureMessage => failureMessage ?? string.Empty; - public System.Exception? SourceException { get; init; } = null; + public System.Exception? SourceException { get; init; } } \ No newline at end of file diff --git a/src/core-taggeds-failure/Failure/Failure.csproj b/src/core-taggeds-failure/Failure/Failure.csproj index 8c64f081..b08d14bb 100644 --- a/src/core-taggeds-failure/Failure/Failure.csproj +++ b/src/core-taggeds-failure/Failure/Failure.csproj @@ -2,6 +2,7 @@ net6.0;net7.0;net8.0 + latest disable enable true From e9cc6a592905f0ec60eacf6c8b52c469ea1e77d3 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 14:30:15 +0400 Subject: [PATCH 04/17] Format code --- .../Failure/Failure.T/T.ToString.cs | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/core-taggeds-failure/Failure/Failure.T/T.ToString.cs b/src/core-taggeds-failure/Failure/Failure.T/T.ToString.cs index a3388c2d..d42e0c65 100644 --- a/src/core-taggeds-failure/Failure/Failure.T/T.ToString.cs +++ b/src/core-taggeds-failure/Failure/Failure.T/T.ToString.cs @@ -1,17 +1,17 @@ using System.Runtime.CompilerServices; -using static System.FormattableString; - -namespace System; - -partial struct Failure -{ - public override string ToString() - => - Invariant( - $"Failure<{typeof(TFailureCode).Name}>:{{ \"FailureCode\": {FailureCode}, \"FailureMessage\": \"{FailureMessage}\", \"SourceException\": {InnerSourceExceptionString()} }}"); - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private string InnerSourceExceptionString() - => - SourceException is null ? "null" : Invariant($"\"{SourceException}\""); -} +using static System.FormattableString; + +namespace System; + +partial struct Failure +{ + public override string ToString() + => + Invariant( + $"Failure<{typeof(TFailureCode).Name}>:{{ \"FailureCode\": {FailureCode}, \"FailureMessage\": \"{FailureMessage}\", \"SourceException\": {InnerSourceExceptionString()} }}"); + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private string InnerSourceExceptionString() + => + SourceException is null ? "null" : Invariant($"\"{SourceException}\""); +} From 1425993f48133fae413da1568b33977a2f8eb91d Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 14:46:02 +0400 Subject: [PATCH 05/17] Failure: Minor refactor: Simplify ToException() result syntax --- src/core-taggeds-failure/Failure/Failure.T/T.Exception.To.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core-taggeds-failure/Failure/Failure.T/T.Exception.To.cs b/src/core-taggeds-failure/Failure/Failure.T/T.Exception.To.cs index 1bdc6a93..baafd70c 100644 --- a/src/core-taggeds-failure/Failure/Failure.T/T.Exception.To.cs +++ b/src/core-taggeds-failure/Failure/Failure.T/T.Exception.To.cs @@ -2,7 +2,7 @@ partial struct Failure { - public Failure.Exception ToException() + public Exception ToException() => new( failureCode: FailureCode, From 8fd7eac86587d86ca9a769e68f4bab67b5147917 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:26:11 +0400 Subject: [PATCH 06/17] Result: Multi-target: Use latest lang version --- src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj | 1 + src/core-taggeds-result/Result.Tests/Result.Tests.csproj | 1 + src/core-taggeds-result/Result/Result.csproj | 1 + 3 files changed, 3 insertions(+) diff --git a/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj b/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj index 762b4efe..e0080c05 100644 --- a/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj +++ b/src/core-taggeds-result/Result.Tests.Old/Result.Tests.Old.csproj @@ -2,6 +2,7 @@ net6.0;net7.0;net8.0 + latest disable enable true diff --git a/src/core-taggeds-result/Result.Tests/Result.Tests.csproj b/src/core-taggeds-result/Result.Tests/Result.Tests.csproj index 5e50c6f5..7a565fe2 100644 --- a/src/core-taggeds-result/Result.Tests/Result.Tests.csproj +++ b/src/core-taggeds-result/Result.Tests/Result.Tests.csproj @@ -2,6 +2,7 @@ net6.0;net7.0;net8.0 + latest disable enable true diff --git a/src/core-taggeds-result/Result/Result.csproj b/src/core-taggeds-result/Result/Result.csproj index ecee4599..b975e1d5 100644 --- a/src/core-taggeds-result/Result/Result.csproj +++ b/src/core-taggeds-result/Result/Result.csproj @@ -2,6 +2,7 @@ net6.0;net7.0;net8.0 + latest disable enable true From 8b0f35aecf50f52d56da47a2021437455199ce69 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:27:00 +0400 Subject: [PATCH 07/17] Taggeds metapackage: Setup project files / Update the tests to NUnit 4.0 --- .../Taggeds.Tests/Taggeds.Tests.csproj | 15 ++- .../Optional.ToResult.cs | 4 +- .../Optional.ToTaggedUnion.cs | 4 +- .../Result.ToOptional.cs | 8 +- .../Result.ToTaggedUnion.cs | 10 +- .../TaggedUnion.ToOptional.cs | 6 +- .../TaggedUnion.ToResult.cs | 8 +- .../Taggeds.Tests/TestData/SomeError.cs | 8 +- .../Taggeds.Tests/TestData/TestDataSource.cs | 100 +++++++++--------- src/core-taggeds/Taggeds/Taggeds.csproj | 1 + 10 files changed, 84 insertions(+), 80 deletions(-) diff --git a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj index 85f2733f..36f25f51 100644 --- a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj +++ b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj @@ -1,12 +1,14 @@  - net6.0;net7.0 + net6.0;net7.0;net8.0 + latest disable enable true true false + true Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack.Core.Tests @@ -14,9 +16,14 @@ - - - + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToResult.cs b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToResult.cs index c528d65f..d347d7de 100644 --- a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToResult.cs +++ b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToResult.cs @@ -20,7 +20,7 @@ public void Optional_ToResult_SourceOptionalIsPresent_ExpectSuccessResultOfSourc var actual = sourceOptional.ToResult(); var expected = Result.Success(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -31,6 +31,6 @@ public void Optional_ToResult_SourceOptionalIsAbsent_ExpectFailureResultOfUnit() var actual = sourceOptional.ToResult(); var expected = Result.Failure(Unit.Value); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs index d4723839..88ff17d2 100644 --- a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs +++ b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs @@ -15,7 +15,7 @@ public void Optional_ToTaggedUnion_OptionalIsPresent_ExpectActualIsFirst( var actual = optional.ToTaggedUnion(); var expected = TaggedUnion.First(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -25,6 +25,6 @@ public void Optional_ToTaggedUnion_OptionalIsAbsent_ExpectActualIsSecond() var actual = optional.ToTaggedUnion(); var expected = TaggedUnion.Second(Unit.Value); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToOptional.cs b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToOptional.cs index d5a092df..f288ead1 100644 --- a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToOptional.cs +++ b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToOptional.cs @@ -15,7 +15,7 @@ public void Result_ToOptional_SourceResultIsDefault_ExpectAbsent() var actual = sourceResult.ToOptional(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -26,7 +26,7 @@ public void Result_ToOptional_SourceResultIsFailure_ExpectUnionSecondOfSourceFai var actual = sourceResult.ToOptional(); var expected = Optional.Absent; - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -37,7 +37,7 @@ public void Result_ToOptional_SourceResultIsSuccessAndSourceValueIsNull_ExpectPr var actual = sourceResult.ToOptional(); var expected = Optional.Present(null); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -49,6 +49,6 @@ public void Result_ToOptional_SourceResultIsSuccessAndSourceValueIsNotNull_Expec var actual = sourceResult.ToOptional(); var expected = Optional.Present(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToTaggedUnion.cs b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToTaggedUnion.cs index 7ad3f822..f78505d7 100644 --- a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToTaggedUnion.cs +++ b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToTaggedUnion.cs @@ -13,9 +13,9 @@ public void Result_ToTaggedUnion_SourceResultIsDefault_ExpectUnionSecondOfDefaul Result sourceResult) { var actual = sourceResult.ToTaggedUnion(); - var expected = TaggedUnion.Second(default(StructType)); + var expected = TaggedUnion.Second(default); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -26,7 +26,7 @@ public void Result_ToTaggedUnion_SourceResultIsFailure_ExpectUnionSecondOfSource var actual = sourceResult.ToTaggedUnion(); var expected = TaggedUnion.Second(SomeTextStructType); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -37,7 +37,7 @@ public void Result_ToTaggedUnion_SourceResultIsSuccessAndSourceValueIsNull_Expec var actual = sourceResult.ToTaggedUnion(); var expected = TaggedUnion.First(null); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -48,6 +48,6 @@ public void Result_ToTaggedUnion_SourceResultIsSuccessAndSourceValueIsNotNull_Ex var actual = sourceResult.ToTaggedUnion(); var expected = TaggedUnion.First(PlusFifteenIdRefType); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs index 8e34dda9..d5941e59 100644 --- a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs +++ b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs @@ -15,7 +15,7 @@ public void TaggedUnion_ToOptional_UnionIsFirst_ExpectPresent( var actual = union.ToOptional(); var expected = Optional.Present(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -25,7 +25,7 @@ public void TaggedUnion_ToOptional_UnionIsDefault_ExpectAbsent() var actual = union.ToOptional(); var expected = Optional.Absent(); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -35,6 +35,6 @@ public void TaggedUnion_ToOptional_UnionIsSecond_ExpectAbsent() var actual = union.ToOptional(); var expected = Optional.Absent(); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToResult.cs b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToResult.cs index e94eb2ab..5fc7a8b6 100644 --- a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToResult.cs +++ b/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToResult.cs @@ -15,7 +15,7 @@ public void TaggedUnion_ToResult_SourceUnionIsDefault_ExpectDefaultResult() var actual = sourceUnion.ToResult(); var expected = default(Result); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -27,7 +27,7 @@ public void TaggedUnion_ToResult_SourceUnionIsSecond_ExpectFailureResult() var actual = sourceUnion.ToResult(); var expected = Result.Failure(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -38,7 +38,7 @@ public void TaggedUnion_ToResult_SourceUnionIsFirstAndSourceValueIsNull_ExpectSu var actual = sourceUnion.ToResult(); var expected = Result.Success(null); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } [Test] @@ -53,6 +53,6 @@ public void TaggedUnion_ToResult_SourceUnionIsFirstAndSourceValueIsNotNull_Expec var actual = sourceUnion.ToResult(); var expected = Result.Success(sourceValue); - Assert.AreEqual(expected, actual); + Assert.That(actual, Is.EqualTo(expected)); } } diff --git a/src/core-taggeds/Taggeds.Tests/TestData/SomeError.cs b/src/core-taggeds/Taggeds.Tests/TestData/SomeError.cs index a80ed3b9..a77a8a66 100644 --- a/src/core-taggeds/Taggeds.Tests/TestData/SomeError.cs +++ b/src/core-taggeds/Taggeds.Tests/TestData/SomeError.cs @@ -3,13 +3,9 @@ namespace PrimeFuncPack.Core.Tests; -internal readonly struct SomeError +internal readonly struct SomeError(int errorCode) { - private readonly int errorCode; - - public SomeError(int errorCode) - => - this.errorCode = errorCode; + private readonly int errorCode = errorCode; public bool Equals(SomeError other) => diff --git a/src/core-taggeds/Taggeds.Tests/TestData/TestDataSource.cs b/src/core-taggeds/Taggeds.Tests/TestData/TestDataSource.cs index acaec403..a2ede9f7 100644 --- a/src/core-taggeds/Taggeds.Tests/TestData/TestDataSource.cs +++ b/src/core-taggeds/Taggeds.Tests/TestData/TestDataSource.cs @@ -6,76 +6,76 @@ namespace PrimeFuncPack.Core.Tests; - internal static class TestDataSource - { - public static IEnumerable SuccessNullTestSource - => - new Result[] - { +internal static class TestDataSource +{ + public static IEnumerable SuccessNullTestSource + => + new Result[] + { Result.Success(null).With(), Result.Success(null), Result.Success(null), - new Result(null), + new(null), null - } - .ToTestSource(); + } + .ToTestSource(); - public static IEnumerable SuccessPlusFifteenIdRefTypeTestSource - => - new Result[] - { + public static IEnumerable SuccessPlusFifteenIdRefTypeTestSource + => + new Result[] + { Result.Success(PlusFifteenIdRefType).With(), Result.Success(PlusFifteenIdRefType), Result.Success(PlusFifteenIdRefType), - new Result(PlusFifteenIdRefType), + new(PlusFifteenIdRefType), PlusFifteenIdRefType - } - .ToTestSource(); + } + .ToTestSource(); - public static IEnumerable FailureDefaultTestSource - => - new Result[] - { + public static IEnumerable FailureDefaultTestSource + => + new Result[] + { default, - new Result(), - new Result(default(StructType)), + new(), + new(default(StructType)), Result.Failure(default(StructType)), Result.Failure(default(StructType)).With(), Result.Failure(default) - } - .ToTestSource(); - - public static IEnumerable FailureSomeTextStructTypeTestSource - => - new Result[] - { - new Result(SomeTextStructType), + } + .ToTestSource(); + + public static IEnumerable FailureSomeTextStructTypeTestSource + => + new Result[] + { + new(SomeTextStructType), Result.Failure(SomeTextStructType), Result.Failure(SomeTextStructType).With(), Result.Failure(SomeTextStructType) - } - .ToTestSource(); + } + .ToTestSource(); - public static IEnumerable ObjectNullableTestSource - => - new object?[] - { + public static IEnumerable ObjectNullableTestSource + => + new object?[] + { null, - new object(), + new(), MinusFifteen, PlusFifteenIdRefType, SomeTextStructType - } - .ToNullableTestSource(); - - private static IEnumerable ToTestSource( - this IEnumerable source) - where T : notnull - => - source.Select( - item => new object[] { item }); + } + .ToNullableTestSource(); + + private static IEnumerable ToTestSource( + this IEnumerable source) + where T : notnull + => + source.Select( + item => new object[] { item }); - private static IEnumerable ToNullableTestSource(this IEnumerable source) - => - source.Select(v => new[] { v }); - } + private static IEnumerable ToNullableTestSource(this IEnumerable source) + => + source.Select(v => new[] { v }); +} diff --git a/src/core-taggeds/Taggeds/Taggeds.csproj b/src/core-taggeds/Taggeds/Taggeds.csproj index a5e0e9bc..6fa04634 100644 --- a/src/core-taggeds/Taggeds/Taggeds.csproj +++ b/src/core-taggeds/Taggeds/Taggeds.csproj @@ -2,6 +2,7 @@ net6.0;net7.0;net8.0 + latest disable enable true From 4a5a408371cbf69cd3abc2fa224afbeb975d97a9 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:34:35 +0400 Subject: [PATCH 08/17] Taggeds metapackage: Move NUnit Tests to Tests.Old --- .../Taggeds.Tests.Old.csproj} | 2 +- .../TaggedsExtensionsTests/Optional.ToResult.cs | 0 .../TaggedsExtensionsTests/Optional.ToTaggedUnion.cs | 0 .../TaggedsExtensionsTests/Result.ToOptional.cs | 0 .../TaggedsExtensionsTests/Result.ToTaggedUnion.cs | 0 .../TaggedsExtensionsTests/TaggedUnion.ToOptional.cs | 0 .../TaggedsExtensionsTests/TaggedUnion.ToResult.cs | 0 .../TaggedsExtensionsTests/Test.cs | 0 .../{Taggeds.Tests => Taggeds.Tests.Old}/TestData/SomeError.cs | 0 .../{Taggeds.Tests => Taggeds.Tests.Old}/TestData/SomeRecord.cs | 0 .../TestData/TestDataSource.cs | 0 11 files changed, 1 insertion(+), 1 deletion(-) rename src/core-taggeds/{Taggeds.Tests/Taggeds.Tests.csproj => Taggeds.Tests.Old/Taggeds.Tests.Old.csproj} (95%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TaggedsExtensionsTests/Optional.ToResult.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TaggedsExtensionsTests/Result.ToOptional.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TaggedsExtensionsTests/Result.ToTaggedUnion.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TaggedsExtensionsTests/TaggedUnion.ToResult.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TaggedsExtensionsTests/Test.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TestData/SomeError.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TestData/SomeRecord.cs (100%) rename src/core-taggeds/{Taggeds.Tests => Taggeds.Tests.Old}/TestData/TestDataSource.cs (100%) diff --git a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj b/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj similarity index 95% rename from src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj rename to src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj index 36f25f51..cec9248b 100644 --- a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj +++ b/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj @@ -12,7 +12,7 @@ Andrei Sergeev, Pavel Moskovoy Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack.Core.Tests - PrimeFuncPack.Core.Taggeds.Tests + PrimeFuncPack.Core.Taggeds.Tests.Old diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToResult.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToResult.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToResult.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToResult.cs diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToOptional.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToOptional.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToOptional.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToOptional.cs diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToTaggedUnion.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToTaggedUnion.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Result.ToTaggedUnion.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToTaggedUnion.cs diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToResult.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToResult.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/TaggedUnion.ToResult.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToResult.cs diff --git a/src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Test.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Test.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TaggedsExtensionsTests/Test.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Test.cs diff --git a/src/core-taggeds/Taggeds.Tests/TestData/SomeError.cs b/src/core-taggeds/Taggeds.Tests.Old/TestData/SomeError.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TestData/SomeError.cs rename to src/core-taggeds/Taggeds.Tests.Old/TestData/SomeError.cs diff --git a/src/core-taggeds/Taggeds.Tests/TestData/SomeRecord.cs b/src/core-taggeds/Taggeds.Tests.Old/TestData/SomeRecord.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TestData/SomeRecord.cs rename to src/core-taggeds/Taggeds.Tests.Old/TestData/SomeRecord.cs diff --git a/src/core-taggeds/Taggeds.Tests/TestData/TestDataSource.cs b/src/core-taggeds/Taggeds.Tests.Old/TestData/TestDataSource.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests/TestData/TestDataSource.cs rename to src/core-taggeds/Taggeds.Tests.Old/TestData/TestDataSource.cs From 36b1d2962b084d33e77cf90d91e137bd8a490bfe Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:36:15 +0400 Subject: [PATCH 09/17] Adust tests file name --- .../TaggedsExtensionsTests/{Test.cs => Tests.cs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/{Test.cs => Tests.cs} (100%) diff --git a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Test.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Tests.cs similarity index 100% rename from src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Test.cs rename to src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Tests.cs From 50e85d992aa8fd5338b5f9da567648b788a35ddd Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:37:29 +0400 Subject: [PATCH 10/17] Taggeds: Use global using for NUnit --- src/core-taggeds/Taggeds.Tests.Old/GlobalUsings.cs | 1 + .../TaggedsExtensionsTests/Optional.ToResult.cs | 1 - .../TaggedsExtensionsTests/Optional.ToTaggedUnion.cs | 3 +-- .../TaggedsExtensionsTests/Result.ToOptional.cs | 1 - .../TaggedsExtensionsTests/Result.ToTaggedUnion.cs | 1 - .../TaggedsExtensionsTests/TaggedUnion.ToOptional.cs | 3 +-- .../TaggedsExtensionsTests/TaggedUnion.ToResult.cs | 1 - 7 files changed, 3 insertions(+), 8 deletions(-) create mode 100644 src/core-taggeds/Taggeds.Tests.Old/GlobalUsings.cs diff --git a/src/core-taggeds/Taggeds.Tests.Old/GlobalUsings.cs b/src/core-taggeds/Taggeds.Tests.Old/GlobalUsings.cs new file mode 100644 index 00000000..cefced49 --- /dev/null +++ b/src/core-taggeds/Taggeds.Tests.Old/GlobalUsings.cs @@ -0,0 +1 @@ +global using NUnit.Framework; \ No newline at end of file diff --git a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToResult.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToResult.cs index d347d7de..c17e14a5 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToResult.cs +++ b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToResult.cs @@ -1,4 +1,3 @@ -using NUnit.Framework; using System; using static PrimeFuncPack.UnitTest.TestData; diff --git a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs index 88ff17d2..76f0bbe2 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs +++ b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Optional.ToTaggedUnion.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; namespace PrimeFuncPack.Core.Tests; diff --git a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToOptional.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToOptional.cs index f288ead1..65cf1a95 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToOptional.cs +++ b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToOptional.cs @@ -1,4 +1,3 @@ -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; diff --git a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToTaggedUnion.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToTaggedUnion.cs index f78505d7..08a55128 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToTaggedUnion.cs +++ b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/Result.ToTaggedUnion.cs @@ -1,4 +1,3 @@ -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; diff --git a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs index d5941e59..f520f55e 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs +++ b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToOptional.cs @@ -1,5 +1,4 @@ -using NUnit.Framework; -using PrimeFuncPack.UnitTest; +using PrimeFuncPack.UnitTest; using System; namespace PrimeFuncPack.Core.Tests; diff --git a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToResult.cs b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToResult.cs index 5fc7a8b6..c7ef2071 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToResult.cs +++ b/src/core-taggeds/Taggeds.Tests.Old/TaggedsExtensionsTests/TaggedUnion.ToResult.cs @@ -1,4 +1,3 @@ -using NUnit.Framework; using PrimeFuncPack.UnitTest; using System; using static PrimeFuncPack.UnitTest.TestData; From 050781e39750e033444629b79e45aab3f25fd4eb Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:49:15 +0400 Subject: [PATCH 11/17] Taggeds: Add new XUnit tests stub --- .../Taggeds.Tests/GlobalUsings.cs | 1 + .../Taggeds.Tests/Taggeds.Tests.csproj | 31 +++++++++++++++++++ src/core-taggeds/Taggeds.Tests/TestStub.cs | 10 ++++++ 3 files changed, 42 insertions(+) create mode 100644 src/core-taggeds/Taggeds.Tests/GlobalUsings.cs create mode 100644 src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj create mode 100644 src/core-taggeds/Taggeds.Tests/TestStub.cs diff --git a/src/core-taggeds/Taggeds.Tests/GlobalUsings.cs b/src/core-taggeds/Taggeds.Tests/GlobalUsings.cs new file mode 100644 index 00000000..8c927eb7 --- /dev/null +++ b/src/core-taggeds/Taggeds.Tests/GlobalUsings.cs @@ -0,0 +1 @@ +global using Xunit; \ No newline at end of file diff --git a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj new file mode 100644 index 00000000..371acc63 --- /dev/null +++ b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj @@ -0,0 +1,31 @@ + + + + net6.0;net7.0;net8.0 + latest + disable + enable + true + true + false + true + Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy + PrimeFuncPack.Core.Tests + PrimeFuncPack.Core.Taggeds.Tests + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + diff --git a/src/core-taggeds/Taggeds.Tests/TestStub.cs b/src/core-taggeds/Taggeds.Tests/TestStub.cs new file mode 100644 index 00000000..05f82c8d --- /dev/null +++ b/src/core-taggeds/Taggeds.Tests/TestStub.cs @@ -0,0 +1,10 @@ +namespace PrimeFuncPack.Core.Tests; + +public static class TestStub +{ + [Fact] + public static void TestTrue() + { + Assert.True(true); + } +} From a06f224bf0c873173038c069a35a44effc2fe1d4 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:51:08 +0400 Subject: [PATCH 12/17] Setup github flow: Add and new tests --- .github/workflows/dotnet.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 9ff1bfce..b5307bab 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -119,6 +119,12 @@ jobs: - name: Pack Taggeds run: dotnet pack ./src/*/*/Taggeds.csproj --no-restore -o ~/nuget -c Release + - name: Restore Taggeds.Tests.Old + run: dotnet restore ./src/*/*/Taggeds.Tests.Old.csproj + + - name: Test Taggeds.Tests.Old + run: dotnet test ./src/*/*/Taggeds.Tests.Old.csproj --no-restore -c Release + - name: Restore Taggeds.Tests run: dotnet restore ./src/*/*/Taggeds.Tests.csproj From 8d2bfae817cd8c0746cf2be2df43b290a4a3f8d2 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 20:55:52 +0400 Subject: [PATCH 13/17] Setup license info --- src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj | 2 +- src/core-taggeds-failure/Failure/Failure.csproj | 2 +- src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj | 2 +- src/core-taggeds/Taggeds/Taggeds.csproj | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj index cecd691d..5ce498ab 100644 --- a/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj +++ b/src/core-taggeds-failure/Failure.Tests/Failure.Tests.csproj @@ -10,7 +10,7 @@ false true Andrei Sergeev, Pavel Moskovoy - Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack.Core.Tests PrimeFuncPack.Core.Failure.Tests diff --git a/src/core-taggeds-failure/Failure/Failure.csproj b/src/core-taggeds-failure/Failure/Failure.csproj index b08d14bb..23aa2f5b 100644 --- a/src/core-taggeds-failure/Failure/Failure.csproj +++ b/src/core-taggeds-failure/Failure/Failure.csproj @@ -14,7 +14,7 @@ https://github.com/pfpack/pfpack-core-taggeds pfpack Andrei Sergeev, Pavel Moskovoy - Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Core.Failure is a core library for .NET consisting of Failure type targeted for use in functional programming. System PrimeFuncPack.Core.Failure diff --git a/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj b/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj index cec9248b..fc7482cc 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj +++ b/src/core-taggeds/Taggeds.Tests.Old/Taggeds.Tests.Old.csproj @@ -10,7 +10,7 @@ false true Andrei Sergeev, Pavel Moskovoy - Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack.Core.Tests PrimeFuncPack.Core.Taggeds.Tests.Old diff --git a/src/core-taggeds/Taggeds/Taggeds.csproj b/src/core-taggeds/Taggeds/Taggeds.csproj index 6fa04634..80a8636d 100644 --- a/src/core-taggeds/Taggeds/Taggeds.csproj +++ b/src/core-taggeds/Taggeds/Taggeds.csproj @@ -14,7 +14,7 @@ https://github.com/pfpack/pfpack-core-taggeds pfpack Andrei Sergeev, Pavel Moskovoy - Copyright © 2020-2023 Andrei Sergeev, Pavel Moskovoy + Copyright © 2020-2024 Andrei Sergeev, Pavel Moskovoy PrimeFuncPack Core.Taggeds is a core pack for .NET consisting of fundamental tagged types targeted for use in functional programming: Optional and Result monads, Tagged Union, as well as the convert extensions. System PrimeFuncPack.Core.Taggeds From 1ff475a901b52b1f689bff169cf30ceb93f0a725 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 21:18:56 +0400 Subject: [PATCH 14/17] Format code --- src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs b/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs index ca0b7a08..71361de6 100644 --- a/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs +++ b/src/core-taggeds-failure/Failure/Failure.T/Failure.T.cs @@ -35,4 +35,4 @@ public string FailureMessage failureMessage ?? string.Empty; public System.Exception? SourceException { get; init; } -} \ No newline at end of file +} From 0c6a92048f7b71a01375df270e0a88032c45b663 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 21:22:43 +0400 Subject: [PATCH 15/17] Format code --- .../TestData/TestDataSource.cs | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/core-taggeds/Taggeds.Tests.Old/TestData/TestDataSource.cs b/src/core-taggeds/Taggeds.Tests.Old/TestData/TestDataSource.cs index a2ede9f7..894e2dcc 100644 --- a/src/core-taggeds/Taggeds.Tests.Old/TestData/TestDataSource.cs +++ b/src/core-taggeds/Taggeds.Tests.Old/TestData/TestDataSource.cs @@ -12,11 +12,11 @@ public static IEnumerable SuccessNullTestSource => new Result[] { - Result.Success(null).With(), - Result.Success(null), - Result.Success(null), - new(null), - null + Result.Success(null).With(), + Result.Success(null), + Result.Success(null), + new(null), + null } .ToTestSource(); @@ -24,11 +24,11 @@ public static IEnumerable SuccessPlusFifteenIdRefTypeTestSource => new Result[] { - Result.Success(PlusFifteenIdRefType).With(), - Result.Success(PlusFifteenIdRefType), - Result.Success(PlusFifteenIdRefType), - new(PlusFifteenIdRefType), - PlusFifteenIdRefType + Result.Success(PlusFifteenIdRefType).With(), + Result.Success(PlusFifteenIdRefType), + Result.Success(PlusFifteenIdRefType), + new(PlusFifteenIdRefType), + PlusFifteenIdRefType } .ToTestSource(); @@ -36,12 +36,12 @@ public static IEnumerable FailureDefaultTestSource => new Result[] { - default, - new(), - new(default(StructType)), - Result.Failure(default(StructType)), - Result.Failure(default(StructType)).With(), - Result.Failure(default) + default, + new(), + new(default(StructType)), + Result.Failure(default(StructType)), + Result.Failure(default(StructType)).With(), + Result.Failure(default) } .ToTestSource(); @@ -49,10 +49,10 @@ public static IEnumerable FailureSomeTextStructTypeTestSource => new Result[] { - new(SomeTextStructType), - Result.Failure(SomeTextStructType), - Result.Failure(SomeTextStructType).With(), - Result.Failure(SomeTextStructType) + new(SomeTextStructType), + Result.Failure(SomeTextStructType), + Result.Failure(SomeTextStructType).With(), + Result.Failure(SomeTextStructType) } .ToTestSource(); @@ -60,11 +60,11 @@ public static IEnumerable ObjectNullableTestSource => new object?[] { - null, - new(), - MinusFifteen, - PlusFifteenIdRefType, - SomeTextStructType + null, + new(), + MinusFifteen, + PlusFifteenIdRefType, + SomeTextStructType } .ToNullableTestSource(); From aad279035e043b84099c16ace6c88f7327639cd7 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 21:34:03 +0400 Subject: [PATCH 16/17] Add Taggeds link to Taggeds.Tests --- src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj index 371acc63..0a81cce5 100644 --- a/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj +++ b/src/core-taggeds/Taggeds.Tests/Taggeds.Tests.csproj @@ -28,4 +28,8 @@ + + + + From 3564f023b66505d071db1aa8008bfcc1057fdf25 Mon Sep 17 00:00:00 2001 From: Andrei Sergeev Date: Sun, 11 Feb 2024 21:40:16 +0400 Subject: [PATCH 17/17] Format code --- src/core-taggeds-failure/Failure/Failure.T/T.Deconstruct.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core-taggeds-failure/Failure/Failure.T/T.Deconstruct.cs b/src/core-taggeds-failure/Failure/Failure.T/T.Deconstruct.cs index 91f3e8d2..97e3c135 100644 --- a/src/core-taggeds-failure/Failure/Failure.T/T.Deconstruct.cs +++ b/src/core-taggeds-failure/Failure/Failure.T/T.Deconstruct.cs @@ -2,13 +2,15 @@ namespace System; partial struct Failure { - public void Deconstruct(out TFailureCode failureCode, out string failureMessage) + public void Deconstruct( + out TFailureCode failureCode, out string failureMessage) { failureCode = FailureCode; failureMessage = FailureMessage; } - public void Deconstruct(out TFailureCode failureCode, out string failureMessage, out System.Exception? sourceException) + public void Deconstruct( + out TFailureCode failureCode, out string failureMessage, out System.Exception? sourceException) { failureCode = FailureCode; failureMessage = FailureMessage;