예제 #1
0
        public async Task Index_Success()
        {
            //Arrange
            var productionQueues = new List <ProductionQueue> {
                new ProductionQueue(), new ProductionQueue()
            };

            productionService.Setup(x => x.GetProductionQueues(It.IsAny <ProductionQueueFilteringData>())).Returns(Task.FromResult(productionQueues));

            //Act
            var action = await productionController.Index(It.IsAny <ProductionQueueFilteringData>()) as ViewResult;

            var model = action.Model as ProductionQueuesViewModel;

            //Assert
            Assert.Equal(productionQueues.Count, model.ProductionQueues.Count);
        }