public async Task IndexLoadingPlace_Success() { //Arrange var loadingPlaces = new List <LoadingPlace> { new LoadingPlace(), new LoadingPlace() }; deliveryService.Setup(x => x.GetLoadingPlaces(It.IsAny <LoadingPlaceFilteringData>())).Returns(Task.FromResult(loadingPlaces)); //Act var action = await deliveryController.IndexLoadingPlace(It.IsAny <LoadingPlaceFilteringData>()) as ViewResult; var model = action.Model as LoadingPlacesViewModel; //Assert Assert.Equal(loadingPlaces.Count, model.LoadingPlaces.Count); }