public void WhenRetrievingEnumWithOutDescriptionThenShouldReturnEnumName() { string description = EnumUtil.Description(BarEnum.Value1); Assert.AreEqual("Value1", description); }
public void WhenNonEnumInstanceThenShouldThrowException() { Assert.ThrowsException <ArgumentException>(() => EnumUtil.Description <Foo>(new Foo()), "T must be an enumerated type."); }
public void WhenRetrievingEnumWithDescriptionThenShouldReturnRespectiveDescription() { string description = EnumUtil.Description(FooEnum.Value1); Assert.AreEqual("Description for Value 1", description); }
public void WhenNullInstanceThenShouldThrowException() { Assert.ThrowsException <ArgumentNullException>(() => EnumUtil.Description <FooEnum?>(null)); }