Skip to content

Commit 642f503

Browse files
authored
Merge branch 'main' into dependabot/nuget/CSharpFunctionalExtensions-3.5.1
2 parents bd52a53 + cf4bd63 commit 642f503

File tree

7 files changed

+112
-113
lines changed

7 files changed

+112
-113
lines changed

.github/workflows/publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
run: dotnet pack ${{ env.PROJECT_PATH }} -c Release --no-build --include-symbols -o ./artifacts/prerelease --version-suffix prerelease-$GITHUB_RUN_NUMBER-$GITHUB_RUN_ATTEMPT
3939

4040
- name: 'Save prerelease artifact'
41-
uses: actions/upload-artifact@v3
41+
uses: actions/upload-artifact@v4
4242
with:
4343
name: prerelease
4444
path: ./artifacts/prerelease/*
@@ -47,7 +47,7 @@ jobs:
4747
run: dotnet pack ${{ env.PROJECT_PATH }} -c Release --no-build --include-symbols -o ./artifacts/release
4848

4949
- name: 'Save release artifact'
50-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
5151
with:
5252
name: release
5353
path: ./artifacts/release/*
@@ -59,7 +59,7 @@ jobs:
5959
runs-on: ubuntu-latest
6060
steps:
6161
- name: Download artifact
62-
uses: actions/download-artifact@v3
62+
uses: actions/download-artifact@v4
6363
with:
6464
name: prerelease
6565

@@ -73,7 +73,7 @@ jobs:
7373
runs-on: ubuntu-latest
7474
steps:
7575
- name: Download artifact
76-
uses: actions/download-artifact@v3
76+
uses: actions/download-artifact@v4
7777
with:
7878
name: release
7979

.vscode/settings.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
"**/bin": true,
1515
"**/obj": true
1616
},
17-
18-
"omnisharp.defaultLaunchSolution": "CSharpFunctionalExtensions.FluentAssertions.sln",
1917
"omnisharp.useEditorFormattingSettings": true,
20-
"omnisharp.enableImportCompletion": true
18+
"dotnet.defaultSolution": "CSharpFunctionalExtensions.FluentAssertions.sln",
19+
"dotnet.completion.showCompletionItemsFromUnimportedNamespaces": true
2120
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 NitroDevs
3+
Copyright (c) 2022-2025 NitroDevs
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ A small set of extensions to make test assertions more fluent when using CSharpF
2222

2323
This library is compatible with .NET 6+. It requires the following minimum package versions:
2424

25-
CSharpFunctionalExtensons >= 2.37.0
25+
CSharpFunctionalExtensons >= 3.0.0
2626

27-
FluentAssertions >= 6.10.0
27+
FluentAssertions >= 7.2.0
2828

2929
## Installation
3030

src/CSharpFunctionalExtensions.FluentAssertions/CSharpFunctionalExtensions.FluentAssertions.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
<ItemGroup>
1717
<PackageReference Include="CSharpFunctionalExtensions" Version="3.5.1" />
18-
<PackageReference Include="FluentAssertions" Version="6.10.0" />
18+
<PackageReference Include="FluentAssertions" Version="7.2.0" />
1919
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
2020
<PrivateAssets>all</PrivateAssets>
2121
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

tests/CSharpFunctionalExtensions.FluentAssertions.Tests/CSharpFunctionalExtensions.FluentAssertions.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<ItemGroup>
99
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
1010
<PackageReference Include="xunit" Version="2.9.3" />
11-
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.0">
11+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.2">
1212
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1313
<PrivateAssets>all</PrivateAssets>
1414
</PackageReference>
Lines changed: 101 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,101 +1,101 @@
1-
using System;
2-
using FluentAssertions;
3-
using Xunit;
4-
using Xunit.Sdk;
5-
6-
namespace CSharpFunctionalExtensions.FluentAssertions.Tests;
7-
public class ResultTEAssertionTests
8-
{
9-
[Fact]
10-
public void WhenResultIsExpectedToBeSuccessItShouldBeSuccess()
11-
{
12-
string value = "value";
13-
var result = Result.Success<string, Exception>(value);
14-
15-
var action = () => result.Should().Succeed();
16-
17-
action.Should().NotThrow();
18-
result.Should().Succeed().Which.Should().Be(value);
19-
}
20-
21-
[Fact]
22-
public void WhenResultIsExpectedToBeSuccessWithValueItShouldBeSuccessWithValue()
23-
{
24-
string value = "value";
25-
var result = Result.Success<string, Exception>(value);
26-
27-
result.Should().SucceedWith(value);
28-
result.Should().SucceedWith(value).Which.Should().Be(value);
29-
}
30-
31-
[Fact]
32-
public void WhenResultIsExpectedToBeSuccessItShouldThrowWhenFailure()
33-
{
34-
var error = new Exception("error");
35-
var result = Result.Failure<string, Exception>(error);
36-
37-
var action = () => result.Should().Succeed();
38-
39-
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} to succeed, but it failed with error ""System.Exception: error""");
40-
}
41-
42-
[Fact]
43-
public void WhenResultIsExpectedToBeSuccessWithValueItShouldThrowWhenSuccessWithDifferentValue()
44-
{
45-
string value = "value";
46-
var result = Result.Success<string, Exception>(value);
47-
48-
var action = () => result.Should().SucceedWith("some other value");
49-
50-
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} value to be ""some other value"", but found ""value""");
51-
}
52-
53-
[Fact]
54-
public void WhenResultIsExpectedToBeFailureItShouldBeFailure()
55-
{
56-
var error = new Exception("error");
57-
var result = Result.Failure<string, Exception>(error);
58-
59-
var action = () => result.Should().Fail();
60-
var actionWith = () => result.Should().FailWith(error);
61-
62-
action.Should().NotThrow();
63-
actionWith.Should().NotThrow();
64-
result.Should().Fail().Which.Should().Be(error);
65-
result.Should().FailWith(error).Which.Should().Be(error);
66-
}
67-
68-
[Fact]
69-
public void WhenResultIsExpectedToBeFailureWithValueItShouldBeFailureWithValue()
70-
{
71-
var error = new Exception("error");
72-
var result = Result.Failure<string, Exception>(error);
73-
74-
result.Should().FailWith(error);
75-
}
76-
77-
[Fact]
78-
public void WhenResultIsExpectedToBeFailureWithValueItShouldThrowWhenFailureWithDifferenceValue()
79-
{
80-
var error = new Exception("error");
81-
var result = Result.Failure<string, Exception>(error);
82-
83-
var action = () => result.Should().FailWith(new Exception("Some other error"));
84-
85-
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} error to be System.Exception with message ""Some other error"", but found System.Exception with message ""error""");
86-
}
87-
88-
[Fact]
89-
public void WhenResultIsExpectedToBeFailureItShouldThrowWhenSuccess()
90-
{
91-
string value = "value";
92-
var someError = new Exception("error");
93-
var result = Result.Success<string, Exception>(value);
94-
95-
var action = () => result.Should().Fail();
96-
var actionWith = () => result.Should().FailWith(someError);
97-
98-
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} to fail, but it succeeded with value ""{value}""");
99-
actionWith.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} to fail, but it succeeded");
100-
}
101-
}
1+
using System;
2+
using FluentAssertions;
3+
using Xunit;
4+
using Xunit.Sdk;
5+
6+
namespace CSharpFunctionalExtensions.FluentAssertions.Tests;
7+
public class ResultTEAssertionTests
8+
{
9+
[Fact]
10+
public void WhenResultIsExpectedToBeSuccessItShouldBeSuccess()
11+
{
12+
string value = "value";
13+
var result = Result.Success<string, Exception>(value);
14+
15+
var action = () => result.Should().Succeed();
16+
17+
action.Should().NotThrow();
18+
result.Should().Succeed().Which.Should().Be(value);
19+
}
20+
21+
[Fact]
22+
public void WhenResultIsExpectedToBeSuccessWithValueItShouldBeSuccessWithValue()
23+
{
24+
string value = "value";
25+
var result = Result.Success<string, Exception>(value);
26+
27+
result.Should().SucceedWith(value);
28+
result.Should().SucceedWith(value).Which.Should().Be(value);
29+
}
30+
31+
[Fact]
32+
public void WhenResultIsExpectedToBeSuccessItShouldThrowWhenFailure()
33+
{
34+
var error = new Exception("error");
35+
var result = Result.Failure<string, Exception>(error);
36+
37+
var action = () => result.Should().Succeed();
38+
39+
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} to succeed, but it failed with error ""System.Exception: error""");
40+
}
41+
42+
[Fact]
43+
public void WhenResultIsExpectedToBeSuccessWithValueItShouldThrowWhenSuccessWithDifferentValue()
44+
{
45+
string value = "value";
46+
var result = Result.Success<string, Exception>(value);
47+
48+
var action = () => result.Should().SucceedWith("some other value");
49+
50+
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} value to be ""some other value"", but found ""value""");
51+
}
52+
53+
[Fact]
54+
public void WhenResultIsExpectedToBeFailureItShouldBeFailure()
55+
{
56+
var error = new Exception("error");
57+
var result = Result.Failure<string, Exception>(error);
58+
59+
var action = () => result.Should().Fail();
60+
var actionWith = () => result.Should().FailWith(error);
61+
62+
action.Should().NotThrow();
63+
actionWith.Should().NotThrow();
64+
result.Should().Fail().Which.Should().Be(error);
65+
result.Should().FailWith(error).Which.Should().Be(error);
66+
}
67+
68+
[Fact]
69+
public void WhenResultIsExpectedToBeFailureWithValueItShouldBeFailureWithValue()
70+
{
71+
var error = new Exception("error");
72+
var result = Result.Failure<string, Exception>(error);
73+
74+
result.Should().FailWith(error);
75+
}
76+
77+
[Fact]
78+
public void WhenResultIsExpectedToBeFailureWithValueItShouldThrowWhenFailureWithDifferenceValue()
79+
{
80+
var error = new Exception("error");
81+
var result = Result.Failure<string, Exception>(error);
82+
83+
var action = () => result.Should().FailWith(new Exception("Some other error"));
84+
85+
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} error to be System.Exception: Some other error, but found System.Exception: error");
86+
}
87+
88+
[Fact]
89+
public void WhenResultIsExpectedToBeFailureItShouldThrowWhenSuccess()
90+
{
91+
string value = "value";
92+
var someError = new Exception("error");
93+
var result = Result.Success<string, Exception>(value);
94+
95+
var action = () => result.Should().Fail();
96+
var actionWith = () => result.Should().FailWith(someError);
97+
98+
action.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} to fail, but it succeeded with value ""{value}""");
99+
actionWith.Should().Throw<XunitException>().WithMessage(@$"Expected {nameof(result)} to fail, but it succeeded");
100+
}
101+
}

0 commit comments

Comments
 (0)