Exemplo n.º 1
0
        public async Task Production_GetProductAsync()
        {
            // Arrange
            var controller = new ProductionController(AdventureWorksRepository);

            // Act
            var response = await controller.GetProduct(1) as ObjectResult;

            // Assert
            var value = response.Value as ISingleModelResponse <ProductViewModel>;

            Assert.False(value.DidError);
        }
        public async Task Production_GetNonExistingProductAsync()
        {
            using (var repository = RepositoryMocker.AdventureWorksRepository)
            {
                // Arrange
                var controller = new ProductionController(repository);
                var id         = 0;

                // Act
                var response = await controller.GetProduct(id) as ObjectResult;

                // Assert
                var value = response.Value as ISingleModelResponse <ProductViewModel>;

                Assert.False(value.DidError);
            }
        }