public void GetProperty_InvalidStringValue_ReturnsInvalid(Type enumType, string stringValue) { var item = new EnumMapper(enumType); object value = 1; PropertyMapperResultType result = item.GetProperty(new ReadCellValueResult(-1, stringValue), ref value); Assert.Equal(PropertyMapperResultType.Invalid, result); Assert.Equal(1, value); }
public void GetProperty_ValidStringValue_ReturnsSuccess(Type enumType, string stringValue, Enum expected) { var item = new EnumMapper(enumType); object value = null; PropertyMapperResultType result = item.GetProperty(new ReadCellValueResult(-1, stringValue), ref value); Assert.Equal(PropertyMapperResultType.Success, result); Assert.Equal(expected, value); }