Пример #1
0
        public async void DoesValidatorPreventFromReadingNonExistentRecipePicture()
        {
            var validator = new GetRecipePictureByIdValidator(MockBuilder.BuildFakeFileStore().Object);
            var request   = new GetRecipePictureById {
                Id = new Guid("DA7F5CDC-FA28-4CC6-90BF-2E7BBE4F885A")
            };

            var result = await validator.ValidateAsync(request);

            result.IsValid.Should().BeFalse();
        }
Пример #2
0
        public async void DoesValidatorAllowCorrectRequest()
        {
            var validator = new GetRecipePictureByIdValidator(MockBuilder.BuildFakeFileStore().Object);
            var request   = new GetRecipePictureById {
                Id = new Guid("F7D85930-4CF4-4B70-A686-18F94ABF4302")
            };

            var result = await validator.ValidateAsync(request);

            result.IsValid.Should().BeTrue();
        }