예제 #1
0
        public void AddProjectType(ProjectType.ICreateParam param)
        {
            var projectType = ProjectType.Create(param);

            unitOfWork.ProjectTypes.Add(projectType);
            unitOfWork.Complete();
        }
        private void CreateProjectType()
        {
            var createParam = new ProjectTypeCreateParam
            {
                Description = "Test description",
                Name        = "Test name"
            };

            this.uow.ProjectTypes.Add(ProjectType.Create(createParam));
            this.uow.Complete();
        }
        public void Create_Test()
        {
            // ARRANGE
            // ...

            // ACT
            var projectType = ProjectType.Create(createParam);

            // ASSERT
            Assert.IsNotNull(projectType);
        }
예제 #4
0
        private void CreateProjectTypes()
        {
            var createParams = new ProjectTypeCreateParam
            {
                Description = "Test description",
                Name        = "Test project type"
            };

            for (int i = 0; i < 3; i++)
            {
                this.uow.ProjectTypes.Add(ProjectType.Create(createParams));
            }
            this.uow.Complete();
        }
        public void Update_Test()
        {
            // ARRANGE
            var    projectType        = ProjectType.Create(createParam);
            string changedName        = "Test name changed";
            string changedDescription = "Test description changed";
            var    updateParam        = new ProjectTypeUpdateParam {
                Description = changedDescription, Name = changedName
            };

            // ACT
            projectType.Update(updateParam);

            // ASSERT
            Assert.AreEqual(changedName, projectType.Name);
            Assert.AreEqual(changedDescription, projectType.Description);
        }
예제 #6
0
 public static IEnumerable <ProjectType> SeedProjectTypes()
 {
     return(new ProjectType[4]
     {
         ProjectType.Create(new ProjectTypeCreateParam {
             Name = "Creative Writing", Description = "A project for creative writing"
         }),
         ProjectType.Create(new ProjectTypeCreateParam {
             Name = "Programming", Description = "A project for creating new applications"
         }),
         ProjectType.Create(new ProjectTypeCreateParam {
             Name = "Sports", Description = "Steeling your body"
         }),
         ProjectType.Create(new ProjectTypeCreateParam {
             Name = "Personal Management", Description = "Get your stuff organized"
         })
     });
 }
        private void CreateTestProjectAndProjectType()
        {
            GetTestUnitOfWork();
            var projectTypeCreateParam = new ProjectTypeCreateParam
            {
                Name        = "Test",
                Description = "Test project type"
            };

            var projectCreateParam = new ProjectCreateParam
            {
                Description = "Project description",
                Name        = "New project",
                ProjectType = ProjectType.Create(projectTypeCreateParam)
            };

            uow.ProjectTypes.Add(ProjectType.Create(projectTypeCreateParam));
            uow.Projects.Add(Project.Create(projectCreateParam));
            uow.Complete();
        }
        private Assignment CreateTestAssignment()
        {
            var projectTypeCreateParam = new ProjectTypeCreateParam
            {
                Name        = "Test",
                Description = "Test project type"
            };

            var projectCreateParam = new ProjectCreateParam
            {
                Description = "Project description",
                Name        = "New project",
                ProjectType = ProjectType.Create(projectTypeCreateParam)
            };

            uow.ProjectTypes.Add(ProjectType.Create(projectTypeCreateParam));
            uow.Projects.Add(Project.Create(projectCreateParam));
            uow.Complete();

            var project = uow.Projects.GetAll().First(p => p.Name == "New project");
            var assignmentCreateParam = new AssignmentCreateParam
            {
                Name                   = "TestAssignment",
                DateDue                = DateTime.Now.AddDays(1),
                DatePlanned            = DateTime.Now,
                Description            = "New description",
                DurationPlannedAsTicks = new TimeSpan(1, 0, 0).Ticks,
                Project                = project
            };

            uow.Assignments.Add(Assignment.Create(assignmentCreateParam));
            uow.Complete();

            var assignment = uow.Assignments.Load(a => a.Name == "TestAssignment").Single();

            return(assignment);
        }
예제 #9
0
        private void CreatePrerequisitesForSubtaskCreation()
        {
            var projectTypeCreateParam = new ProjectTypeCreateParam
            {
                Name        = "Test",
                Description = "Test project type"
            };

            uow.ProjectTypes.Add(ProjectType.Create(projectTypeCreateParam));
            this.uow.Complete();

            var projectType        = this.uow.ProjectTypes.GetAll().First();
            var projectCreateParam = new ProjectCreateParam
            {
                Description = "Project description",
                Name        = "New project",
                ProjectType = projectType
            };

            uow.Projects.Add(Project.Create(projectCreateParam));
            this.uow.Complete();

            var project = this.uow.Projects.GetAll().First();
            var assignmentCreateParam = new AssignmentCreateParam
            {
                Name                   = "TestAssignment",
                DateDue                = DateTime.Now.AddDays(1),
                DatePlanned            = DateTime.Now,
                Description            = "New description",
                DurationPlannedAsTicks = new TimeSpan(1, 0, 0).Ticks,
                Project                = project
            };

            uow.Assignments.Add(Assignment.Create(assignmentCreateParam));
            this.uow.Complete();
        }
        private void CreateEntries()
        {
            var projectTypeCreateParam = new ProjectTypeCreateParam
            {
                Name        = "Test",
                Description = "Test project type"
            };

            uow.ProjectTypes.Add(ProjectType.Create(projectTypeCreateParam));
            this.uow.Complete();

            var projectType        = this.uow.ProjectTypes.GetAll().First();
            var projectCreateParam = new ProjectCreateParam
            {
                Description = "Project description",
                Name        = "New project",
                ProjectType = projectType
            };

            uow.Projects.Add(Project.Create(projectCreateParam));
            this.uow.Complete();

            var project = this.uow.Projects.GetAll().First();
            var assignmentCreateParam = new AssignmentCreateParam
            {
                Name                   = "TestAssignment",
                DateDue                = DateTime.Now.AddDays(1),
                DatePlanned            = DateTime.Now,
                Description            = "New description",
                DurationPlannedAsTicks = new TimeSpan(1, 0, 0).Ticks,
                Project                = project
            };

            uow.Assignments.Add(Assignment.Create(assignmentCreateParam));
            this.uow.Complete();
            var assignment = this.uow.Assignments.GetAll().First();
            var subtask    = Subtask.Create(new SubtaskCreateParam
            {
                Name        = "Test subtask",
                Description = "Test description",
                Priority    = EnumDefinition.SubtaskPriority.Medium
            });

            subtask.Assignment_Id = assignment.Id;
            subtask.Assignment    = assignment;
            this.uow.Subtasks.Add(subtask);
            this.uow.Complete();

            var entryCreateParam = new EntryCreateParam
            {
                Comment = "Test comment",
                Date    = DateTime.Now.Date,
                Started = DateTime.Now.AddHours(-2),
                Ended   = DateTime.Now.AddHours(-1),
                Name    = "Test entry",
                Project = project
            };

            for (int i = 0; i < 3; i++)
            {
                this.uow.Entries.Add(Entry.Create(entryCreateParam));
            }

            this.uow.Complete();
        }