public void List_WhenActionExecute_ReturnsViewNameList() { //Act var result = sut.List() as ViewResult; //Assert Assert.Equal <string>(result.ViewName, "List"); }
public void List_WhenActionExecute_ReturnModelContainsListOfCars() { //Arrange repositoryStub.Setup(x => x.GetAllCars()).Returns (() => new List <Car> { new Car { } }); //Act var result = sut.List() as ViewResult; //Assert Assert.True(((IEnumerable <Car>)result.Model).Any()); }