コード例 #1
0
        public void SettingNameSucceeds()
        {
            //arrange
            var fame = TyraTheModelBuilder.Build();

            fame.ModelName = "Candice Swanepoel";
            var validator = new MyValidator();

            //act
            bool valid = validator.IsValid(fame);

            //assert
            Assert.IsTrue(valid);
        }
コード例 #2
0
        public void NotSettingNameFails()
        {
            //arrange
            var remainsNameless = TyraTheModelBuilder.Build();

            remainsNameless.ModelName = String.Empty;
            var validator = new MyValidator();

            //act
            bool valid = validator.IsValid(remainsNameless);

            //assert
            Assert.IsFalse(valid);
        }