コード例 #1
0
        public void Game_ViewUsers_Returns_ActionResult()
        {
            //Arrange
            GamesAdminController Controller = new GamesAdminController(_mockServiceLayer.Object);

            //Act
            ViewResult result = Controller.ViewUsers(_game);

            //Assert
            Assert.IsInstanceOf <ViewResult>(result);
        }
コード例 #2
0
        public void Game_Index_Returns_ViewResult()
        {
            //Arrange
            GamesAdminController Controller = new GamesAdminController(_mockServiceLayer.Object);

            //Act
            ViewResult result = Controller.Index();

            //Assert
            Assert.IsInstanceOf <ViewResult>(result);
        }
コード例 #3
0
        public void Game_Create_Returns_ViewResult()
        {
            //Arrange
            GamesAdminController Controller = new GamesAdminController(_mockServiceLayer.Object);
            var _opStatus = new OperationStatus();

            _mockServiceLayer.Setup(s => s.CreateGame(_game.CreatorId, _game.Name)).Returns(_opStatus);

            //Act
            ViewResult result = Controller.Create(_game);

            //Assert
            Assert.IsInstanceOf <ViewResult>(result);
        }
コード例 #4
0
        public void Game_AddUserToGame_Returns_ActionResult()
        {
            //Arrange
            GamesAdminController Controller = new GamesAdminController(_mockServiceLayer.Object);
            var _opStatus = new OperationStatus();

            _mockServiceLayer.Setup(s => s.AddUserToGame(123, 123));

            //Act
            ActionResult result = Controller.AddUserToGame(123, 123);

            //Assert
            Assert.IsInstanceOf <ActionResult>(result);
        }