Exemplo n.º 1
0
        public void AboutReturnsViewResultWithModel()
        {
            //Arrange
            Game game = new TestContext().Games.FirstOrDefault();

            var mock = new Mock <IStore>();

            mock.Setup(m => m.GetGame(0)).Returns(game);
            var controller = new StoreController(mock.Object);
            //Act
            var result = controller.About(0);
            //Assert
            var model = Assert.IsType <ViewResult>(result);

            Assert.NotNull(model.Model);
            Assert.Equal(game, model.Model);
        }