Ejemplo n.º 1
0
        public void WhenRetrievingEnumWithOutDescriptionThenShouldReturnEnumName()
        {
            string description = EnumUtil.Description(BarEnum.Value1);

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

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