コード例 #1
0
        public void GetAllProdutos_ShouldReturnAllProdutosDTO()
        {
            // Arrange
            var TestContext   = ProducaoContextMocker.GetProducaoContext();
            var theController = new ProdutoController(TestContext);

            //Act
            var result = theController.GetProdutos();

            //Assert
            Assert.NotNull(result);
            Assert.IsType <List <ProdutoDTO> >(result);
        }
コード例 #2
0
        public void GetProdutoByNome_ShouldReturnProdutoDTO()
        {
            // Arrange
            var    TestContext   = ProducaoContextMocker.GetProducaoContext();
            var    theController = new ProdutoController(TestContext);
            String nome          = "ProdutoBase";

            //Act
            var result = theController.GetProdutoByNome(nome);

            //Assert
            Assert.NotNull(result);
            Assert.IsType <ActionResult <ProdutoDTO> >(result);
        }