Пример #1
0
        public async Task GetByCodPedido_Should_Return_Ok()
        {
            //Arrange
            var pedido = PedidoBuilder.GetPedidoTest();

            //Act
            _mock.Setup(x => x.GetByCodPedido("CP00000-01")).Returns(pedido);
            var result = await _controller.GetByCodPedido("CP00000-01") as OkObjectResult;

            //Assert
            result.Should().NotBeNull("Result is null.");
            result.Value.Should().BeOfType <PedidoModel>($"Return type is not List<PedidoModel>");
            result.StatusCode.Should().Be(200, $"Status Code {result.StatusCode}");
        }