public void Update_Calls_Modifier([ValueSource(nameof(Statuses))] StandardsApplicableStatus status) { var logic = new StandardsApplicableLogic(_modifier.Object, _datastore.Object, _validator.Object, _filter.Object, _context.Object); var claim = Creator.GetStandardsApplicable(status: status); var valres = new ValidationResult(); _validator.Setup(x => x.Validate(It.IsAny <ValidationContext>())).Returns(valres); logic.Update(claim); _modifier.Verify(x => x.ForUpdate(claim), Times.Once); }
public void Update_CallsValidator_WithRuleset() { var logic = new StandardsApplicableLogic(_modifier.Object, _datastore.Object, _validator.Object, _filter.Object, _context.Object); var claim = Creator.GetStandardsApplicable(); var valres = new ValidationResult(); _validator.Setup(x => x.Validate(It.IsAny <ValidationContext>())).Returns(valres); logic.Update(claim); _validator.Verify(x => x.ValidateAndThrowEx( It.Is <StandardsApplicable>(c => c == claim), It.Is <string>(rs => rs == nameof(IClaimsLogic <StandardsApplicable> .Update))), Times.Once()); }