public void FromCharTest() { ActiveInactiveType target = EnumConvert <ActiveInactiveType> .FromChar('A'); Assert.IsTrue(target == ActiveInactiveType.Active); target = EnumConvert <ActiveInactiveType> .FromChar('I'); Assert.IsTrue(target == ActiveInactiveType.Inactive); }
public void FromIntTest() { ActiveInactiveType target = EnumConvert <ActiveInactiveType> .FromInt(Convert.ToInt32('A')); Assert.IsTrue(target == ActiveInactiveType.Active); target = EnumConvert <ActiveInactiveType> .FromInt(Convert.ToInt32('I')); Assert.IsTrue(target == ActiveInactiveType.Inactive); }
public void ToEnumTest() { char target = 'A'; ActiveInactiveType result = EnumConvert <ActiveInactiveType> .ToEnum(target); Assert.IsTrue(result == ActiveInactiveType.Active); result = EnumConvert <ActiveInactiveType> .ToEnum(Convert.ToInt32(target)); Assert.IsTrue(result == ActiveInactiveType.Active); target = 'I'; result = EnumConvert <ActiveInactiveType> .ToEnum(target); Assert.IsTrue(result == ActiveInactiveType.Inactive); result = EnumConvert <ActiveInactiveType> .ToEnum(Convert.ToInt32(target)); Assert.IsTrue(result == ActiveInactiveType.Inactive); }