コード例 #1
0
        public void TestProjectController_Projects_ShouldReturnProjectsViewWithProjectsModel(string httpMethod)
        {
            SetUpProjectControllerForTesting(httpMethod);
            projectController.CurrentUser = user;

            ProjectsModel projectsModel = new ProjectsModel();

            projectsModel.ProjectId = projectId;

            FormCollection form = new FormCollection();

            projectController.Session["RequestAction"]       = null;
            projectController.Session["RequestController"]   = null;
            projectController.Session["ProjectId"]           = null;
            projectController.Session["QuoteId"]             = null;
            projectController.Session["CommissionRequestid"] = null;

            ViewResult result = projectController.Projects(projectsModel, form, null) as ViewResult;

            Assert.That(result, Is.Not.EqualTo(null));
            Assert.That(result.Model, Is.Not.EqualTo(null));
            Assert.That(result.ViewName, Is.EqualTo("Projects"));
            Assert.IsInstanceOf <ProjectsModel>(result.Model);
        }