Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ jobs:
run: |
dotnet tool install --global dotnet-coverage
.\.sonar\scanner\dotnet-sonarscanner begin /k:"astar-development_${{ env.SONAR_PROJECT }}" /o:"astar-development" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths=coverage.xml /d:sonar.scanner.scanAll=false /d:sonar.scanner.skipJreProvisioning=true
dotnet build --configuration Release
dotnet build
dotnet-coverage collect 'dotnet test --filter "FullyQualifiedName!~Tests.EndToEnd"' -f xml -o 'coverage.xml'
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
<IsPackable>true</IsPackable>
<PackageReadmeFile>Readme.md</PackageReadmeFile>
<Title>AStar.Dev.Functional.Extensions</Title>
<Copyright>AStar Development 2025</Copyright>
<PackageReleaseNotes>A complete rewrite of Result etc., and additional extensions / objects.</PackageReleaseNotes>
Expand All @@ -34,11 +35,10 @@
</ItemGroup>

<ItemGroup>
<None Include="blog-post.md" Pack="true" PackagePath="\"/>
<None Include="Readme.md" Pack="true" PackagePath="\"/>
<None Include="Readme-result.md" Pack="true" PackagePath="\"/>
<None Include="Readme-option.md" Pack="true" PackagePath="\"/>
<None Update="astar.png" Pack="true" PackagePath="\"/>
<None Include="..\..\astar.png" Pack="True" PackagePath="/" Link="astar.png"/>
<None Include="..\..\Readme.md" Pack="True" PackagePath="/" Link="Readme.md"/>
<None Include="..\..\Readme-option.md" Pack="True" PackagePath="/" Link="Readme-option.md"/>
<None Include="..\..\Readme-result.md" Pack="True" PackagePath="/" Link="Readme-result.md"/>
</ItemGroup>

</Project>
Binary file removed src/AStar.Dev.Functional.Extensions/astar.png
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void MapSuccessValueWhenResultIsOk()

var matchResult = mapped.Match(
ok => ok,
err => throw new("Should not be error")
err => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -31,7 +31,7 @@ public void PreserveErrorWhenMappingFailedResult()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -49,7 +49,7 @@ public async Task MapSuccessValueAsyncWhenResultIsOk()

var matchResult = mapped.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -65,7 +65,7 @@ public async Task PreserveErrorWhenMappingFailedResultAsync()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -83,7 +83,7 @@ public async Task MapSuccessValueFromTaskResultWhenResultIsOk()

var matchResult = mapped.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -99,7 +99,7 @@ public async Task PreserveErrorWhenMappingFailedTaskResult()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -117,7 +117,7 @@ public async Task MapSuccessValueAsyncFromTaskResultWhenResultIsOk()

var matchResult = mapped.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -133,7 +133,7 @@ public async Task PreserveErrorWhenMappingFailedTaskResultAsync()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -154,7 +154,7 @@ public void MapErrorValueWhenResultIsError()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -172,7 +172,7 @@ public void PreserveSuccessWhenMapFailureOnSuccessResult()

var matchResult = mapped.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("success");
Expand All @@ -188,7 +188,7 @@ public async Task MapErrorValueAsyncWhenResultIsError()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -206,7 +206,7 @@ public async Task PreserveSuccessWhenMapFailureAsyncOnSuccessResult()

var matchResult = mapped.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("success");
Expand All @@ -222,7 +222,7 @@ public async Task MapErrorValueFromTaskResultWhenResultIsError()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -240,7 +240,7 @@ public async Task PreserveSuccessWhenMapFailureOnSuccessTaskResult()

var matchResult = mapped.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("success");
Expand All @@ -256,7 +256,7 @@ public async Task MapErrorValueAsyncFromTaskResultWhenResultIsError()
mapped.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = mapped.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -274,7 +274,7 @@ public async Task PreserveSuccessWhenMapFailureAsyncOnSuccessTaskResult()

var matchResult = mapped.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("success");
Expand All @@ -295,7 +295,7 @@ public void BindSuccessValueToNewResultWhenResultIsOk()

var matchResult = bound.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -311,7 +311,7 @@ public void BindSuccessValueToErrorResultWhenBindFunctionReturnsError()
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -328,7 +328,7 @@ public void PreserveErrorWhenBindingFailedResult()
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -346,7 +346,7 @@ public async Task BindSuccessValueAsyncToNewResultWhenResultIsOk()

var matchResult = bound.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -362,7 +362,7 @@ public async Task BindSuccessValueAsyncToErrorResultWhenBindFunctionReturnsError
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -379,7 +379,7 @@ public async Task PreserveErrorWhenBindingAsyncFailedResult()
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -397,7 +397,7 @@ public async Task BindSuccessValueFromTaskResultWhenResultIsOk()

var matchResult = bound.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -413,7 +413,7 @@ public async Task BindSuccessValueFromTaskResultToErrorWhenBindFunctionReturnsEr
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -430,7 +430,7 @@ public async Task PreserveErrorWhenBindingFailedTaskResult()
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -448,7 +448,7 @@ public async Task BindSuccessValueFromTaskResultAsyncWhenResultIsOk()

var matchResult = bound.Match(
ok => ok,
_ => throw new("Should not be error")
_ => throw new InvalidOperationException("Should not be error")
);

matchResult.ShouldBe("42");
Expand All @@ -464,7 +464,7 @@ public async Task BindSuccessValueFromTaskResultAsyncToErrorWhenBindFunctionRetu
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand All @@ -481,7 +481,7 @@ public async Task PreserveErrorWhenBindingFailedTaskResultAsync()
bound.ShouldBeOfType<Result<string, string>.Error>();

var matchResult = bound.Match(
_ => throw new("Should not be success"),
_ => throw new InvalidOperationException("Should not be success"),
err => err
);

Expand Down
Loading