public void Parse_Throws_GivenValueNotConvertibleToTValue() { var typeHandler = new SmartEnumByValueTypeHandler <TestEnum>(); Action act = () => typeHandler.Parse("abc"); act.Should().Throw <ArgumentException>(); }
public void Parse_ReturnsNull_GivenDbNullValue() { var typeHandler = new SmartEnumByValueTypeHandler <TestEnum>(); var result = typeHandler.Parse(DBNull.Value); result.Should().BeNull(); }
public void Parse_ReturnsSmartEnumFromValue_GivenValueConvertibleToTValue() { var typeHandler = new SmartEnumByValueTypeHandler <TestEnum>(); long value = 3; var result = typeHandler.Parse(value); result.Should().BeSameAs(TestEnum.Three); }