コード例 #1
0
        public void EditProject()
        {
            //arrange
            var project = projectRepo.GetProjectByID(1);

            //act
            project.ProjectName = "waka waka";
            projectRepo.ProjectUpdate(project);
            var project1 = projectRepo.GetProjectByID(1);

            //assert
            Assert.Equal("waka waka", project1.ProjectName);
        }
コード例 #2
0
        public IActionResult EditProject(int projectID) //for when the admin edits a project
        {
            //pulls project from database using passed-in ProjectID
            Project project = projectRepo.GetProjectByID(projectID);
            //posts necessary project attributes to viewmodel to pass to view
            VMEditProject projectVM = new VMEditProject {
                LastName     = project.Client.LastName,
                FirstName    = project.Client.FirstName, Email = project.Client.Email,
                ProjectName  = project.ProjectName, OriginalEstimate = project.OriginalEstimate,
                StartDate    = project.StartDate, Status = project.ProjectStatus,
                StatusDate   = project.StatusDate,
                ProjectID    = project.ProjectID, AdditionalCost = project.AdditionalCosts,
                CurrentTotal = project.TotalCost
            };

            return(View(projectVM));
        }