Beispiel #1
0
        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);
        }
Beispiel #2
0
        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." });
        }