-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Description
Description
According to the documentation, with the standard method Should().Be(), the Enum comparison should work the same as the .NET Implementation Enum.Equals() method.
However, with the following code this does not work for me.
public enum MyEnumResult
{
Successfully,
Failed
}
public enum MySecondEnumResult
{
Successfully,
AnotherValue,
Failed
}
[Test]
public void MyTest()
{
MyEnumResult result = _sut.Get(_id);
//This works as expected
result.Should().Be(MyEnumResult.Successfully);
//This works also, but should not
result.Should().Be(MySecondEnumResult.Successfully);
}Although the two enums are not of the same type, the test does not fail. Apparently only the underlying value is tested, but not the type.
Versions
- Fluent Assertions version is 5.10.3
- .NET framework 4.7.2
Metadata
Metadata
Assignees
Labels
No labels