Пример #1
0
        public void RenderDefaultViewWithModelTeamAdminViewModels()
        {
            // Arrange
            var teamService    = new Mock <ITeamService>();
            var teamController = new Team_Manager.Controllers.TeamController(teamService.Object);

            // Act & Assert
            teamController.WithCallTo(c => c.AllTeams())
            .ShouldRenderDefaultView().WithModel <IEnumerable <TeamAdminViewModel> >();
        }
Пример #2
0
        public void RenderPartialView()
        {
            // Arrange
            var teamService    = new Mock <ITeamService>();
            var teamController = new Team_Manager.Controllers.TeamController(teamService.Object);

            // Act & Assert
            teamController
            .WithCallTo(c => c.AddComment())
            .ShouldRenderPartialView("_AddComment");
        }
Пример #3
0
        public void ReturnDefaultView()
        {
            // Arrange
            var teamService    = new Mock <ITeamService>();
            var teamController = new Team_Manager.Controllers.TeamController(teamService.Object);

            // Act & Assert
            teamController
            .WithCallTo(c => c.AllTeams())
            .ShouldRenderDefaultView();
        }
Пример #4
0
        public void RenderViewCreateTeam()
        {
            // Arrange
            var teamService    = new Mock <ITeamService>();
            var teamController = new Team_Manager.Controllers.TeamController(teamService.Object);

            // Act & Assert
            teamController
            .WithCallTo(c => c.CreateTeam())
            .ShouldRenderView("CreateTeam");
        }
Пример #5
0
        public void ReturnViewResultWithNullModel_WhenTheServicePassesNullModel()
        {
            // Arrange
            var teamService = new Mock <ITeamService>();

            teamService.Setup(m => m.GetAllTeams()).Returns((IEnumerable <TeamAdminViewModel>)null);

            var teamController = new Team_Manager.Controllers.TeamController(teamService.Object);

            // Act
            var result = teamController.AllTeams() as ViewResult;

            // Assert
            Assert.IsNull(result.Model);
        }