Example #1
0
        public void Create_RootProject()
        {
            Project root = new Project();
            User executor = new User();

            executor.Create(root);

            Assert.That(executor.RootProjects.Count, Is.EqualTo(1));
            Assert.That(executor.RootProjects.Contains(root));

            project_founder_previlege(executor, root);
        }
Example #2
0
        public void Create_Project_In_Parent_Project()
        {
            Project parent_Project = new Project();
            Project new_created_project = new Project
            {
                Parent = parent_Project,
                Name = "",
                Description = ""
            };
            User executor = new User();

            executor.Create(new_created_project);

            Assert.That(executor.RootProjects.Count, Is.EqualTo(1));
            Assert.That(executor.RootProjects.Contains(parent_Project));

            Assert.That(parent_Project.Children.Count == 1);
            Assert.That(parent_Project.Children.Contains(new_created_project));

            project_founder_previlege(executor, new_created_project);
        }
 internal static Project create(User user, string name, string description, ProjectConfig config, Project parent)
 {
     Project project = new Project { Name = name, Description = description, Config = config, Parent = parent };
     user.Create(project);
     return project;
 }