public void ShouldConstructWithDiscretPropertiesIfNeeded() { AbstractMockObject mock = ConstructDiscreteHelper <AbstractMockObject>(); PropertyInfo property = mock.GetType().GetProperty("__LastName"); mock.LastName = "sampleValue"; Assert.AreEqual("sampleValue", property.GetGetMethod().Invoke(mock, null)); property = mock.GetType().GetProperty("__MiddleName"); property.GetSetMethod().Invoke(mock, new Object[1] { "middleName" }); Assert.AreEqual("middleName", mock.MiddleName); property = mock.GetType().GetProperty("__FirstName"); Assert.IsNull(property); }
public void ShouldBeAbleToCallAbstractProperties() { AbstractMockObject mock = ConstructDiscreteHelper <AbstractMockObject>(); PropertyInfo property = mock.GetType().GetProperty("__MiddleName"); property.GetSetMethod().Invoke(mock, new Object[1] { "middleName" }); Assert.AreEqual("middleName", mock.GetMiddleName()); }