Exemple #1
0
        public void WhenRetrievingEnumWithOutDescriptionThenShouldReturnEnumName()
        {
            string description = EnumUtil.Description(BarEnum.Value1);

            Assert.AreEqual("Value1", description);
        }
Exemple #2
0
 public void WhenNonEnumInstanceThenShouldThrowException()
 {
     Assert.ThrowsException <ArgumentException>(() => EnumUtil.Description <Foo>(new Foo()), "T must be an enumerated type.");
 }
Exemple #3
0
        public void WhenRetrievingEnumWithDescriptionThenShouldReturnRespectiveDescription()
        {
            string description = EnumUtil.Description(FooEnum.Value1);

            Assert.AreEqual("Description for Value 1", description);
        }
Exemple #4
0
 public void WhenNullInstanceThenShouldThrowException()
 {
     Assert.ThrowsException <ArgumentNullException>(() => EnumUtil.Description <FooEnum?>(null));
 }