Ejemplo n.º 1
0
        public void Get_WhenCalled_ReturnsActionResult()
        {
            //Arrange
            controller = new RecipeController(mediatorMock.Object);
            mediatorMock.Setup(m => m.Send(It.IsAny <List.Query>(), It.IsAny <CancellationToken>()))
            .ReturnsAsync(new List.RecipesEnvelope(new List <RecipeDto>(), new int()))
            .Verifiable("RecipesEnvelope was not sent");

            //Act
            var response = controller.List();

            //Assert
            Assert.IsType <ActionResult <List.RecipesEnvelope> >(response.Result);
        }