mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 18:13:42 +00:00
Adds unit tests improving domain project code coverage
This commit is contained in:
1 parent
208f102070
commit
0ec6eb7ab4
25 files changed
+1577
-12
No files matched your search
@@ -295,6 +295,39 @@ public class ResultTests
|
||||
Assert.True(firstResult.Equals(secondResult));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WhenOneResultIsSuccessfulAndTheOtherIsFailed_ShouldReturnFalse()
|
||||
{
|
||||
// Act
|
||||
Result<string> successResult = Result<string>.Success("test");
|
||||
Result<string> failureResult = Result<string>.Failure(Error.Validation("Code", "Description"));
|
||||
|
||||
// Assert
|
||||
Assert.False(successResult.Equals(failureResult));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WhenCalledWithBoxedResult_ShouldReturnTrue()
|
||||
{
|
||||
// Act
|
||||
Result<string> firstResult = Result<string>.Success("test");
|
||||
object boxedResult = Result<string>.Success("test");
|
||||
|
||||
// Assert
|
||||
Assert.True(firstResult.Equals(boxedResult));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Equals_WhenCalledWithNonResultObject_ShouldReturnFalse()
|
||||
{
|
||||
// Act
|
||||
Result<string> result = Result<string>.Success("test");
|
||||
object nonResultObject = new();
|
||||
|
||||
// Assert
|
||||
Assert.False(result.Equals(nonResultObject));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EqualityOperator_WhenResultsAreEqual_ShouldReturnTrue()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user