public void AddChild_WhenAddingChildProject_ChildIsAddedToTheList()
        {
            var childProject = new Project("childProjectUrl");

            this.testee.AddChild(childProject);

            this.testee.ChildProjects.Should().Contain(childProject);
        }
        public void RemoveChild_WhenRemovingChildProject_ChildIsRemovedFromTheList()
        {
            var childProject = new Project("childProjectUrl");

            this.testee.AddChild(childProject);

            this.testee.RemoveChild(childProject);

            this.testee.ChildProjects.Should().BeEmpty();
        }
        private void RemoveFromCurrentParent(Project changedProject)
        {
            var currentParent = this.Projects.FirstOrDefault(project => project.ChildProjects.Contains(changedProject));

            if (currentParent != null)
            {
                currentParent.RemoveChild(changedProject);
            }
        }
        private void FillProjects(IEnumerable<projectref> projectRefs)
        {
            foreach (var projectRef in projectRefs)
            {
                var project = new Project(projectRef.href);
                this.projects.Add(project);

                project.PropertyChanged += this.ProjectOnPropertyChanged;
            }

            this.OnPropertyChanged("Projects");
        }
 private void AddToNewParent(Project changedProject)
 {
     var parentProject = this.Projects.FirstOrDefault(project => project.Id == changedProject.ParentId);
     parentProject.AddChild(changedProject);
     changedProject.Parent = parentProject;
 }
 public void SetUp()
 {
     this.testee = new Project(Url);
     this.projectDto = new project
     {
         id = "projectId",
         name = "projectName",
         description = "projectDescprition",
         parentProject = new projectref { id = "parentProjectId" },
         buildTypes = new List<buildTyperef>
                      {
                          new buildTyperef
                          {
                              href = "buildtype1Href"
                          },
                          new buildTyperef
                          {
                              href = "buildtype2Href"
                          }
                      }
     };
 }