public void Should_Match_And_Inject_Demicals() { //Create an instance of our test class var testInstance = new DecimalTestClass(); //Create an instance of our DecimalSelector var selector = new DecimalSelector(); //Iterate over the test object's properties foreach(var property in testInstance.GetType().GetProperties()) { Assert.IsTrue(selector.CanBind(property), string.Format("should have been able to bind to property {0}", property.Name)); //Inject the value into this property on our test instance class selector.Generate(testInstance, property); //Get the value out of the property var fieldValue = (decimal)property.GetValue(testInstance, null); Assert.IsNotNull(fieldValue); Assert.AreNotEqual(fieldValue, default(decimal)); } }
public void Should_Match_And_Inject_Demicals() { //Create an instance of our test class var testInstance = new DecimalTestClass(); //Create an instance of our DecimalSelector var selector = new DecimalSelector(); //Iterate over the test object's properties foreach (var property in testInstance.GetType().GetProperties()) { Assert.IsTrue(selector.CanBind(property), string.Format("should have been able to bind to property {0}", property.Name)); //Inject the value into this property on our test instance class selector.Generate(testInstance, property); //Get the value out of the property var fieldValue = (decimal)property.GetValue(testInstance, null); Assert.IsNotNull(fieldValue); Assert.AreNotEqual(fieldValue, default(decimal)); } }