Beispiel #1
0
        public async Task And_All_Fields_Valid_Then_Valid(
            GetCohortQuery query,
            GetCohortQueryValidator validator)
        {
            var result = await validator.ValidateAsync(query);

            result.IsValid().Should().BeTrue();
            result.ValidationDictionary.Count.Should().Be(0);
        }
Beispiel #2
0
        public async Task And_No_Id_Then_Invalid(
            GetCohortQueryValidator validator)
        {
            var query = new GetCohortQuery();

            var result = await validator.ValidateAsync(query);

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