public void ShouldTakeDescriptionAttributeDuringConversion() { object converted = new EnumValueConverter().Convert(EnumTestCase.Two, null, null, null); Assert.IsInstanceOfType(converted, typeof(string)); Assert.AreEqual<string>("description", (string)converted); }
public void ShouldReturnNullValueString() { object converted = new EnumValueConverter().Convert(null, null, null, null); Assert.IsInstanceOfType(converted, typeof(string)); Assert.AreEqual<string>(EnumValueConverter.NullValueString, (string)converted); }
public void ShouldConvertNonEnumValueToString() { object converted = new EnumValueConverter().Convert(1234, null, null, null); Assert.IsInstanceOfType(converted, typeof(string)); Assert.AreEqual<string>("1234", (string)converted); }
public void ShouldConvertToStringForEmptyDescriptionAttribute() { object converted = new EnumValueConverter().Convert(EnumTestCase.Three, null, null, null); Assert.IsInstanceOfType(converted, typeof(string)); Assert.AreEqual<string>("Three", (string)converted); }
public void ShoudConvertEnumToString() { object converted = new EnumValueConverter().Convert(EnumTestCase.One, null, null, null); Assert.IsInstanceOfType(converted, typeof(string)); Assert.AreEqual<string>("One", (string)converted); }