コード例 #1
0
        public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondAttributeWhenHasMarkedAttribute()
        {
            var sut = new RequireForCompletnessValidator(new GeneralViewModelThatDoesNotHaveAnyAttributes());

            Assert.AreEqual(0, sut.All.Count);
            Assert.AreEqual(0, sut.Failed.Count);
        }
コード例 #2
0
        public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondBaseWhenPropertiesHAsNoValues()
        {
            var sut = new RequireForCompletnessValidator(new GeneralModelThatHaveRequiredForCompletnessBaseAttributes());

            Assert.AreEqual(2, sut.All.Count);
            Assert.AreEqual(2, sut.Failed.Count);
        }
コード例 #3
0
 public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondAttributeWhenSomePropertiesMarkedHasValuesSomeDont()
 {
     var sut = new RequireForCompletnessValidator(new GeneralModelThatHaveRequiredForCompletnessBaseAttributes
     {
         AppAcronym = 13
     });
     Assert.AreEqual(2, sut.All.Count);
     Assert.AreEqual(1, sut.Failed.Count);
 }
コード例 #4
0
        public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondAttributeWhenPropertiesHAsNoValues()
        {
            var sut = new RequireForCompletnessValidator(new GeneralModelThatHaveRequiredForCompletnessBaseAttributes());

            var all = sut.All;
            var failed = sut.Failed;
            Assert.IsNotNull(all);
            Assert.IsNotNull(failed);
        }
コード例 #5
0
 public ActionResult Index()
 {
     ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
     var app = new Application { FirstName = "param",LastName = "Singh" ,City = "Olathe" };
     var validator = new RequireForCompletnessValidator(app);
     ViewData["validator"] = validator;
     ViewData["application"] = app;
     return View();
 }
コード例 #6
0
 public void RequiredForCompletenessThrowNullRefrenceExceptionWhenSuppliedObjectIsNull()
 {
     var sut = new RequireForCompletnessValidator(null);
     Assert.IsNull(sut);
 }