// Simple check to see if model is valid // This is only used for final validation to detect account changes or tampering // therefore does not need to feed back errors to user public bool Validate(PaymentOptionsVm paymentOptionsVm) { PaymentOptionsVmValidator validator = new PaymentOptionsVmValidator(); ValidationResult result = validator.Validate(paymentOptionsVm); return(result.IsValid); }
public void Initialise() { _validator = new PaymentOptionsVmValidator(); _accountVm = new PaymentOptionsVm() { OutstandingBalance = 100, AcceptTermsAndConditions = true, SelectedPaymentOption = PaymentOptionsSelectionsVm.Values.FullPayment, DirectDebitStartDateEarliest = new DateTime(2018, 8, 28), DirectDebitStartDateLatest = new DateTime(2018, 8, 29), DirectDebitSelectedStartDate = "28/08/2018" }; }