public void Should_valldate_input() { var validator = new ValidatorSpy(); var m = new MultiplierProgram(validator); Assert.Throws <Exception>(() => m.Process("abc")); Assert.That(validator.WasCalled, Is.True); }
public void Should_validate_input() { var validatorSpy = new ValidatorSpy(); var a = new AdderProgram(validatorSpy); var ex = Assert.Throws <Exception>(() => a.Process("a")); Assert.That(validatorSpy.WasCalled, Is.True); Assert.That(ex.Message, Does.Contain("Invalid input: must be comma separated list of numbers")); }