Пример #1
0
        public async Task And_All_Fields_Valid_Then_Valid(
            GetTrustedEmployersQuery query,
            GetTrustedEmployerQueryValidator validator)
        {
            var result = await validator.ValidateAsync(query);

            result.IsValid().Should().BeTrue();
            result.ValidationDictionary.Count.Should().Be(0);
        }
Пример #2
0
        public async Task And_No_Id_Then_Invalid(
            GetTrustedEmployerQueryValidator validator)
        {
            var query = new GetTrustedEmployersQuery();

            var result = await validator.ValidateAsync(query);

            result.IsValid().Should().BeFalse();
            result.ValidationDictionary.Count.Should().Be(1);
            result.ValidationDictionary
            .Should().ContainKey(nameof(GetTrustedEmployersQuery.UkPrn))
            .WhichValue.Should().Be($"{nameof(GetTrustedEmployersQuery.UkPrn)} has not been supplied");
        }