示例#1
0
        public void List_WhenActionExecute_ReturnsViewNameList()
        {
            //Act
            var result = sut.List() as ViewResult;

            //Assert
            Assert.Equal <string>(result.ViewName, "List");
        }
示例#2
0
        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());
        }