public void DatePast_Date_Aujourdhui() { ModeleDate modeleDateAujourdhui = new ModeleDate() { Valeur = DateTime.Today }; ValidationContext context = new ValidationContext(modeleDateAujourdhui); DatePast datePast = new DatePast(); ValidationResult validationResult = datePast.GetValidationResult(modeleDateAujourdhui.Valeur, context); Assert.AreNotEqual(validationResult, ValidationResult.Success); }
public void DatePast_Date_Futur() { ModeleDate modeleDateDemain = new ModeleDate() { Valeur = DateTime.Today.AddDays(1) }; ValidationContext context = new ValidationContext(modeleDateDemain); DatePast datePast = new DatePast(); ValidationResult validationResult = datePast.GetValidationResult(modeleDateDemain.Valeur, context); Assert.AreNotEqual(validationResult, ValidationResult.Success); }
public void DatePast_Date_Passee() { ModeleDate modeleDateHier = new ModeleDate() { Valeur = DateTime.Today.AddDays(-1) }; ValidationContext context = new ValidationContext(modeleDateHier); DatePast datePast = new DatePast(); ValidationResult validationResult = datePast.GetValidationResult(modeleDateHier.Valeur, context); Assert.AreEqual(validationResult, ValidationResult.Success); }