public void ReturnsDefaultEnumGivenNonMatchingValue() { var value = string.Empty; var defaultEnum = TestStringEnum.One; var result = TestStringEnum.FromValue(value, defaultEnum); result.Should().BeSameAs(defaultEnum); }
public void ThrowsGivenNonMatchingValue() { var value = string.Empty; Action action = () => TestStringEnum.FromValue(value); action.Should() .ThrowExactly <SmartEnumNotFoundException>() .WithMessage($"No {typeof(TestStringEnum).Name} with Value {value} found."); }
public void NotEqualOperatorReturnsExpected(TestStringEnum left, TestStringEnum right, bool expected) { var result = left != right; result.Should().Be(!expected); }
public void EqualsSmartEnumReturnsExpected(TestStringEnum left, TestStringEnum right, bool expected) { var result = left.Equals(right); result.Should().Be(expected); }
public void ReturnsEnumGivenMatchingValue(string value, TestStringEnum expected) { var result = TestStringEnum.FromValue(value); result.Should().BeSameAs(expected); }