public async Task IndexPack_Success() { //Arrange var packs = new List <PackToDelivery> { new PackToDelivery(), new PackToDelivery() }; deliveryService.Setup(x => x.GetPacks(It.IsAny <PackFilteringData>())).Returns(Task.FromResult(packs)); //Act var action = await deliveryController.IndexPack(It.IsAny <PackFilteringData>()) as ViewResult; var model = action.Model as PacksViewModel; //Assert Assert.Equal(packs.Count, model.Packs.Count); }