diff --git a/src/GuardCore/Guard.cs b/src/GuardCore/Guard.cs index e1e88fb..c9f45f9 100644 --- a/src/GuardCore/Guard.cs +++ b/src/GuardCore/Guard.cs @@ -1,4 +1,4 @@ -namespace GuardCore; +namespace Takayama.GuardCore; public static class Guard { diff --git a/src/GuardCore/GuardCore.csproj b/src/GuardCore/GuardCore.csproj index 8c035af..06d1ae1 100644 --- a/src/GuardCore/GuardCore.csproj +++ b/src/GuardCore/GuardCore.csproj @@ -5,8 +5,8 @@ netstandard2.0;netstandard2.1;net8.0;net9.0;net10.0 - GuardCore - GuardCore + Takayama.GuardCore + Takayama.GuardCore enable enable diff --git a/src/GuardCore/Result.cs b/src/GuardCore/Result.cs index 69f9fe4..04649fd 100644 --- a/src/GuardCore/Result.cs +++ b/src/GuardCore/Result.cs @@ -1,4 +1,4 @@ -namespace GuardCore; +namespace Takayama.GuardCore; public readonly struct Result where TError : Enum { diff --git a/src/GuardCore/ResultExtensions.cs b/src/GuardCore/ResultExtensions.cs index 9fad7d2..19f2dd7 100644 --- a/src/GuardCore/ResultExtensions.cs +++ b/src/GuardCore/ResultExtensions.cs @@ -1,4 +1,4 @@ -namespace GuardCore; +namespace Takayama.GuardCore; /// /// Transforms the inner error type if the result is a failure. diff --git a/src/GuardCore/Unit.cs b/src/GuardCore/Unit.cs index 3bc9bd3..fad2abb 100644 --- a/src/GuardCore/Unit.cs +++ b/src/GuardCore/Unit.cs @@ -1,4 +1,4 @@ -namespace GuardCore +namespace Takayama.GuardCore { /// /// Represents a type with only one value. diff --git a/tests/GuardCore.Tests/EnsureTests.cs b/tests/GuardCore.Tests/EnsureTests.cs index 68c7740..8dd5d17 100644 --- a/tests/GuardCore.Tests/EnsureTests.cs +++ b/tests/GuardCore.Tests/EnsureTests.cs @@ -1,4 +1,4 @@ -namespace GuardCore.Tests; +namespace Takayama.GuardCore.Tests; public class EnsureTests { @@ -31,4 +31,4 @@ public void Ensure_WhenConditionPasses_ShouldNotThrow() { Should.NotThrow(() => Guard.Ensure(true, "This should never throw")); } -} \ No newline at end of file +} diff --git a/tests/GuardCore.Tests/GuardCore.Tests.csproj b/tests/GuardCore.Tests/GuardCore.Tests.csproj index b2b4bf4..5c74009 100644 --- a/tests/GuardCore.Tests/GuardCore.Tests.csproj +++ b/tests/GuardCore.Tests/GuardCore.Tests.csproj @@ -42,7 +42,7 @@ - + diff --git a/tests/GuardCore.Tests/GuardStateLogicTests.cs b/tests/GuardCore.Tests/GuardStateLogicTests.cs index fbbbb6e..88e244b 100644 --- a/tests/GuardCore.Tests/GuardStateLogicTests.cs +++ b/tests/GuardCore.Tests/GuardStateLogicTests.cs @@ -1,4 +1,4 @@ -namespace GuardCore.Tests; +namespace Takayama.GuardCore.Tests; public class GuardStateLogicTests { @@ -48,4 +48,4 @@ public void Deconstruct_ShouldUnpackInternalStateFieldsCorrectly() isSuccess.ShouldBeFalse(); error.ShouldBe(TestError.InvalidId); } -} \ No newline at end of file +} diff --git a/tests/GuardCore.Tests/GuardStateTerminalTests.cs b/tests/GuardCore.Tests/GuardStateTerminalTests.cs index 68db79d..921c9a5 100644 --- a/tests/GuardCore.Tests/GuardStateTerminalTests.cs +++ b/tests/GuardCore.Tests/GuardStateTerminalTests.cs @@ -1,4 +1,4 @@ -namespace GuardCore.Tests; +namespace Takayama.GuardCore.Tests; public class GuardStateTerminalTests { @@ -59,4 +59,4 @@ public void ToResult_WhenSuccess_ShouldReturnUnitSuccessResult() result.IsSuccess.ShouldBeTrue(); result.Value.ShouldBe(Unit.Default); } -} \ No newline at end of file +} diff --git a/tests/GuardCore.Tests/ResultExtensionsTests.cs b/tests/GuardCore.Tests/ResultExtensionsTests.cs index ed6c461..ddc97eb 100644 --- a/tests/GuardCore.Tests/ResultExtensionsTests.cs +++ b/tests/GuardCore.Tests/ResultExtensionsTests.cs @@ -1,4 +1,4 @@ -namespace GuardCore.Tests; +namespace Takayama.GuardCore.Tests; public class ResultExtensionsTests { @@ -7,8 +7,8 @@ public void MapError_WhenResultIsFailure_ShouldTransformErrorTypeNatively() { Result failureResult = TestError.ValueTooHigh; Result transformed = failureResult.MapError(err => - err == TestError.ValueTooHigh - ? AlternateError.TranslatedFault + err == TestError.ValueTooHigh + ? AlternateError.TranslatedFault : AlternateError.None); transformed.Failed.ShouldBeTrue(); @@ -24,4 +24,4 @@ public void MapError_WhenResultIsSuccess_ShouldForwardValueUnchanged() transformed.IsSuccess.ShouldBeTrue(); transformed.Value.ShouldBe("PreserveMe"); } -} \ No newline at end of file +} diff --git a/tests/GuardCore.Tests/ResultTests.cs b/tests/GuardCore.Tests/ResultTests.cs index 79f925f..5b30ed3 100644 --- a/tests/GuardCore.Tests/ResultTests.cs +++ b/tests/GuardCore.Tests/ResultTests.cs @@ -1,4 +1,4 @@ -namespace GuardCore.Tests; +namespace Takayama.GuardCore.Tests; public enum AlternateError { @@ -31,7 +31,7 @@ public void ImplicitConversion_FromValue_ShouldCreateValidSuccessResult() result.IsSuccess.ShouldBeTrue(); result.Failed.ShouldBeFalse(); result.Value.ShouldBe("SystemNormalized"); - + Should.Throw(() => { var _ = result.Error; }) .Message.ShouldBe("Cannot access Error of a successful Result container."); } @@ -66,15 +66,15 @@ public void Map_WhenSuccess_ShouldTransformInnerValueTypeNatively() mapped.IsSuccess.ShouldBeTrue(); mapped.Value.ShouldBe(100); } - + [Fact] public void Bind_WhenSuccess_ShouldChainMonadicOperationsWithoutAllocating() { Result initial = "100"; - var bound = initial.Bind(val => - int.TryParse(val, out int cleanInt) - ? new Result(cleanInt) + var bound = initial.Bind(val => + int.TryParse(val, out int cleanInt) + ? new Result(cleanInt) : new Result(TestError.FallbackError)); bound.IsSuccess.ShouldBeTrue(); @@ -104,4 +104,4 @@ public void Deconstruct_ShouldUnpackInternalStateNatively() isSuccess.ShouldBeTrue(); value.ShouldBe("DataStream"); } -} \ No newline at end of file +} diff --git a/tests/GuardCore.Tests/TestError.cs b/tests/GuardCore.Tests/TestError.cs index 1c8cde1..c104436 100644 --- a/tests/GuardCore.Tests/TestError.cs +++ b/tests/GuardCore.Tests/TestError.cs @@ -1,4 +1,4 @@ -namespace GuardCore.Tests; +namespace Takayama.GuardCore.Tests; public enum TestError { @@ -7,4 +7,4 @@ public enum TestError ValueTooLow, ValueTooHigh, FallbackError -} \ No newline at end of file +} diff --git a/tests/GuardCore.Tests/UniTests.cs b/tests/GuardCore.Tests/UniTests.cs index 290383c..d7a1b0f 100644 --- a/tests/GuardCore.Tests/UniTests.cs +++ b/tests/GuardCore.Tests/UniTests.cs @@ -1,4 +1,4 @@ -namespace GuardCore.Tests; +namespace Takayama.GuardCore.Tests; public class UnitTests { @@ -15,4 +15,4 @@ public void UnitDefault_ShouldAlwaysBeEqualAndReturnExpectedString() unit1.ToString().ShouldBe("()"); unit1.CompareTo(unit2).ShouldBe(0); } -} \ No newline at end of file +}