public void ShouldNotHaveAnyValidationErrors(int x, int y, decimal radius) { var options = new OptionsWrapper <CbRfCurseSettings>(new CbRfCurseSettings { Radius = radius }); var validator = new CursRequestValidator(options); var command = new CursRequest { X = x, Y = y }; var result = validator.TestValidate(command); result.ShouldNotHaveAnyValidationErrors(); }
public void ShouldHaveAnyValidationError(int x, int y, decimal radius) { var options = new OptionsWrapper <CbRfCurseSettings>(new CbRfCurseSettings { Radius = radius }); var validator = new CursRequestValidator(options); var command = new CursRequest { X = x, Y = y }; Action act = () => validator.Validate(command, options => { options.ThrowOnFailures(); }); act.Should().Throw <RadiusInvalidException>(); }