Skip to content

Commit 9677946

Browse files
committed
Update ResultTests to check for non-null empty Errors
Modified assertions in ResultTests.cs to ensure the Errors property is not null but an empty collection when the result is successful. This aligns with the updated Result class implementation where Errors is initialized as an empty collection instead of being null.
1 parent 11b85fd commit 9677946

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

DomainValidation.UnitTests/ResultTests.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,26 @@ public void Result_ConstructorWithMessage_Success_ReturnsIsSuccessTrue()
3939
{
4040
var result = new Result(true, "Operation successful");
4141
Assert.True(result.IsSuccess);
42-
Assert.Null(result.Errors);
42+
Assert.NotNull(result.Errors);
43+
Assert.Empty(result.Errors);
4344
}
4445

4546
[Fact]
4647
public void Result_ConstructorErrorNone_Success_ReturnsIsSuccessTrue()
4748
{
4849
var result = new Result(true, Error.None);
4950
Assert.True(result.IsSuccess);
50-
Assert.Null(result.Errors);
51+
Assert.NotNull(result.Errors);
52+
Assert.Empty(result.Errors);
5153
}
5254

5355
[Fact]
5456
public void Result_ConstructorWithoutMessage_Success_ReturnsIsSuccessTrue()
5557
{
5658
var result = new Result(true);
5759
Assert.True(result.IsSuccess);
58-
Assert.Null(result.Errors);
60+
Assert.NotNull(result.Errors);
61+
Assert.Empty(result.Errors);
5962
}
6063

6164
[Fact]

0 commit comments

Comments
 (0)