public async Task Should_not_add_error_if_value_is_allowed() { var sut = new AllowedValuesValidator <int>(100, 200); await sut.ValidateAsync(100, errors); Assert.Empty(errors); }
public async Task Should_add_error_if_value_is_not_allowed() { var sut = new AllowedValuesValidator <int>(100, 200); await sut.ValidateAsync(50, errors); errors.ShouldBeEquivalentTo( new[] { "<FIELD> is not an allowed value." }); }