public void GivenPossibleKey_WhenCheckingIfKeyIsEnumValueObject_ThenShouldReturnTrueIfKeyRecognized(string possibleKey, bool isIn) { // Act var isEnumValueObject = TestEnumValueObject.Is(possibleKey); // Assert isEnumValueObject.ShouldBe(isIn); }
public void GivenInvalidKey_WhenCreatingEnumValueObject_ThenErrorResult() { // Act var result = TestEnumValueObject.Create("InvalidKey"); // Assert result.IsFailure.ShouldBeTrue(); result.Error.ShouldBe("The type 'InvalidKey' is not a valid TestEnumValueObject."); }
public void GivenEnumValueObject_WhenComparingEqualOnes_ThenEqual() { // Arrange var enum1 = TestEnumValueObject.One; var alsoEnum1 = TestEnumValueObject.Create("One").Value; // Act var isEqual = enum1 == alsoEnum1; isEqual.ShouldBeTrue(); }