Ejemplo n.º 1
0
        public void IngredientDoesntExist_ShouldThrow()
        {
            // arrange
            var query = new GetIngredientByIdQuery(int.MaxValue);

            // act
            Action act = () => this.RunQuery(query);

            // assert
            act.Should().Throw <IngredientNotFoundException>();
        }
Ejemplo n.º 2
0
        public void HappyPath()
        {
            // arrange
            var command = this.IngredientDataProvider.CreateCommand();

            this.RunCommand(command);

            var query = new GetIngredientByIdQuery(command.Id.Value);

            // act
            var actual = this.RunQuery(query);

            // assert
            actual.Should().NotBeNull();
            actual.Should().BeEquivalentTo(command);
        }