public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondAttributeWhenHasMarkedAttribute() { var sut = new RequireForCompletnessValidator(new GeneralViewModelThatDoesNotHaveAnyAttributes()); Assert.AreEqual(0, sut.All.Count); Assert.AreEqual(0, sut.Failed.Count); }
public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondBaseWhenPropertiesHAsNoValues() { var sut = new RequireForCompletnessValidator(new GeneralModelThatHaveRequiredForCompletnessBaseAttributes()); Assert.AreEqual(2, sut.All.Count); Assert.AreEqual(2, sut.Failed.Count); }
public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondAttributeWhenSomePropertiesMarkedHasValuesSomeDont() { var sut = new RequireForCompletnessValidator(new GeneralModelThatHaveRequiredForCompletnessBaseAttributes { AppAcronym = 13 }); Assert.AreEqual(2, sut.All.Count); Assert.AreEqual(1, sut.Failed.Count); }
public void RequiredForCompletenessShouldValidateTheRequiredForCompletiondAttributeWhenPropertiesHAsNoValues() { var sut = new RequireForCompletnessValidator(new GeneralModelThatHaveRequiredForCompletnessBaseAttributes()); var all = sut.All; var failed = sut.Failed; Assert.IsNotNull(all); Assert.IsNotNull(failed); }
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(); }
public void RequiredForCompletenessThrowNullRefrenceExceptionWhenSuppliedObjectIsNull() { var sut = new RequireForCompletnessValidator(null); Assert.IsNull(sut); }