public void Test_InvalidMessage_WhenMessageSet_ShouldReturnMessage() { //---------------Set up test pack------------------- ReflectionPropertyMapperStub propMapper = new ReflectionPropertyMapperStub(); propMapper.SetPropInfo(new FakePropertyInfo()); var expectedMessage = RandomValueGen.GetRandomString(); propMapper.SetIvalidMessage(expectedMessage); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var invalidMessage = propMapper.InvalidReason; //---------------Test Result ----------------------- Assert.AreEqual(expectedMessage, invalidMessage); }
public void Test_InvalidMessage_WhenPropNull_ShouldReturnStdMessage() { //---------------Set up test pack------------------- ReflectionPropertyMapperStub propMapper = new ReflectionPropertyMapperStub(); PropertyInfo boPropStub = null; propMapper.SetPropInfo(boPropStub); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var invalidMessage = propMapper.InvalidReason; //---------------Test Result ----------------------- var expectedMessage = string.Format("The Property '{0}' is not available" , propMapper.PropertyName); Assert.AreEqual(expectedMessage, invalidMessage); }
public void Test_InvalidMessage_WhenMessageSet_ShouldReturnMessage() { //---------------Set up test pack------------------- ReflectionPropertyMapperStub propMapper = new ReflectionPropertyMapperStub(); propMapper.SetPropInfo(new FakePropertyInfo()); var expectedMessage = RandomValueGen.GetRandomString(); propMapper.SetIvalidMessage(expectedMessage); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var invalidMessage = propMapper.InvalidReason; //---------------Test Result ----------------------- Assert.AreEqual(expectedMessage, invalidMessage); }
public void Test_InvalidMessage_WhenPropNull_ShouldReturnStdMessage() { //---------------Set up test pack------------------- ReflectionPropertyMapperStub propMapper = new ReflectionPropertyMapperStub(); PropertyInfo boPropStub = null; propMapper.SetPropInfo(boPropStub); //---------------Assert Precondition---------------- //---------------Execute Test ---------------------- var invalidMessage = propMapper.InvalidReason; //---------------Test Result ----------------------- var expectedMessage = string.Format("The Property '{0}' is not available" , propMapper.PropertyName); Assert.AreEqual(expectedMessage, invalidMessage); }