public async void DoesValidatorPreventRequestWithNonExistentRecipe() { // "D8B765B2-D11B-46E8-8142-E7A9BFBA7286" - sample non existent recipe var query = new GetRecipeById(new Guid("D8B765B2-D11B-46E8-8142-E7A9BFBA7286")); var validator = new GetRecipeByIdValidator(MockBuilder.BuildFakeRepository()); var result = await validator.ValidateAsync(query); result.IsValid.Should().BeFalse(); }
public async void DoesValidatorAllowCorrectRequest() { // "447EA0EF-F828-486A-91A9-0EDBC01D0B89" - sample existing recipe var query = new GetRecipeById(new Guid("447EA0EF-F828-486A-91A9-0EDBC01D0B89")); var validator = new GetRecipeByIdValidator(MockBuilder.BuildFakeRepository()); var result = await validator.ValidateAsync(query); result.IsValid.Should().BeTrue(); }