public void TestGetDescriptionNoFallback() { SampleEnum val = SampleEnum.Val2; string desc = val.GetDescription(); Assert.AreEqual("Val2", desc); }
public void TestGetDescriptionOutOfRange() { SampleEnum val = (SampleEnum)3; string desc = val.GetDescription(); Assert.AreEqual("Val2", desc); }
public void TestGetDescription() { SampleEnum val1 = SampleEnum.Val1; string desc = val1.GetDescription(); Assert.AreEqual("Value: 1", desc); }
public void GetDescription_DefaultEnum_ReturnZeroToString() { // Arrange SampleEnum sample = default; // Act var ret = sample.GetDescription(); // Assert ret.Should().Be(0.ToString()); }
public void GetDescription_NoMatchingValue_ReturnToString() { // Arrange var evil = 666; SampleEnum sample = (SampleEnum)evil; // Act var ret = sample.GetDescription(); // Assert ret.Should().Be(evil.ToString()); }