Пример #1
0
        public void TestProjectController_ProjectDuplicate(string httpMethod)
        {
            SetUpProjectControllerForTesting(httpMethod);
            projectController.CurrentUser = user;

            ProjectModel model = projectService.GetProjectModel(user, projectId).Model as ProjectModel;

            projectController.ViewData["PageMessages"] = new Messages();
            projectController.ViewData["KeyMessages"]  = new Messages();

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

            ViewResult result = projectController.ProjectDuplicate(model) as ViewResult;

            Assert.That(this.response.HasError, Is.EqualTo(false));
            Assert.That(result, Is.Not.EqualTo(null));
            Assert.That(result.Model, Is.Not.EqualTo(null));
            Assert.That(result.Model.GetType(), Is.EqualTo(typeof(ProjectsModel)));
            Assert.That(result.ViewName, Is.EqualTo("Projects"));
        }