示例#1
0
        public void Test_SetPropertyValue_WhenPropertyNull_ShouldDoNothing()
        {
            //Ideally this should raise an error but code this is replacing behaves like this
            // I will review in the future Brett: 01 Jul 2010
            //---------------Set up test pack-------------------
            const string        propName         = "Surname";
            BOPropertyMapperSpy boPropertyMapper = new BOPropertyMapperSpy(propName);
            var contactPersonTestBO = new ContactPersonTestBO();

            boPropertyMapper.BusinessObject = contactPersonTestBO;
            boPropertyMapper.SetBOProp(null);
            //---------------Assert Precondition----------------
            Assert.IsNull(boPropertyMapper.Property);
            Assert.AreEqual(propName, boPropertyMapper.PropertyName);
            Assert.IsNull(contactPersonTestBO.Surname);
            //---------------Execute Test ----------------------
            boPropertyMapper.SetPropertyValue(RandomValueGen.GetRandomString());
            //---------------Test Result -----------------------
            Assert.IsNull(contactPersonTestBO.Surname);
        }
 public void Test_SetPropertyValue_WhenPropertyNull_ShouldDoNothing()
 {
     //Ideally this should raise an error but code this is replacing behaves like this
     // I will review in the future Brett: 01 Jul 2010
     //---------------Set up test pack-------------------
     const string propName = "Surname";
     BOPropertyMapperSpy boPropertyMapper = new BOPropertyMapperSpy(propName);
     var contactPersonTestBO = new ContactPersonTestBO();
     boPropertyMapper.BusinessObject = contactPersonTestBO;
     boPropertyMapper.SetBOProp(null);
     //---------------Assert Precondition----------------
     Assert.IsNull(boPropertyMapper.Property);
     Assert.AreEqual(propName, boPropertyMapper.PropertyName);
     Assert.IsNull(contactPersonTestBO.Surname);
     //---------------Execute Test ----------------------
     boPropertyMapper.SetPropertyValue(RandomValueGen.GetRandomString());
     //---------------Test Result -----------------------
     Assert.IsNull(contactPersonTestBO.Surname);
 }