public void ValidationShouldGoThroughWhenEndDateAndStartDateAreSame() { DateTime startDate = DateTime.Now; DateTime endDate = startDate; var billDateValidationAttribute = new BillDateValidationAttribute(); var billViewModel = new BillViewModel { StartFrom = startDate }; var validationContext = new ValidationContext(billViewModel); billDateValidationAttribute.Validate(endDate, validationContext); }
public void ValidationShouldGoThroughWhenEndDateIsGreaterThanStartDate() { DateTime startDate = DateTime.Now; DateTime endDate = DateTime.Now.AddDays(10); var billDateValidationAttribute = new BillDateValidationAttribute(); var billViewModel = new BillViewModel { StartFrom = startDate }; var validationContext = new ValidationContext(billViewModel); billDateValidationAttribute.Validate(endDate, validationContext); }
public void ShouldValidateIfEndDateIsLessThanStartDate() { DateTime startDate = DateTime.Now.AddDays(10); DateTime endDate = DateTime.Now; var billDateValidationAttribute = new BillDateValidationAttribute(); var billViewModel = new BillViewModel { StartFrom = startDate }; var validationContext = new ValidationContext(billViewModel); billDateValidationAttribute.Validate(endDate, validationContext); }