public void ApplyTransform_StringField_ExeptionThrown() { var record = new MockRecord() { StringField = "10" }; var property = typeof(MockRecord).GetProperty(nameof(MockRecord.StringField)); var ceilingAttribute = new CeilingAttribute(); ceilingAttribute.ApplyTransform(property, record); }
public void ApplyTransform_IntField_ExceptionIsThrown() { var record = new MockRecord() { IntField = 10 }; var property = typeof(MockRecord).GetProperty(nameof(MockRecord.IntField)); var ceilingAttribute = new CeilingAttribute(); ceilingAttribute.ApplyTransform(property, record); }
public void ApplyTransform_DecimalField1_CeilingAppliedToProperty() { var record = new MockRecord() { DecimalField = 10m }; var property = typeof(MockRecord).GetProperty(nameof(MockRecord.DecimalField)); var ceilingAttribute = new CeilingAttribute(); ceilingAttribute.ApplyTransform(property, record); Assert.AreEqual(10m, record.DecimalField); }
public void ApplyTransform_NullableDoubleField_CeilingAppliedToProperty() { var record = new MockRecord() { NullableDoubleField = 10.1d }; var property = typeof(MockRecord).GetProperty(nameof(MockRecord.NullableDoubleField)); var ceilingAttribute = new CeilingAttribute(); ceilingAttribute.ApplyTransform(property, record); Assert.AreEqual(11d, record.NullableDoubleField); }