public void Returns_Most_Recently_Set_Project_As_Root() { var root = new DomainRoot(); var project = new Project(); root.SetRoot(project); Assert.AreEqual <Project>(project, root.GetRoot()); }
public void Save(IProject itemToUpdate) { if (itemToUpdate == null) { throw new ArgumentNullException("itemToUpdate"); } if (_domainRoot.GetRoot() == null) { _domainRoot.SetRoot(new Project(itemToUpdate)); } else { _domainRoot.GetRoot().CopyProjectPropertiesFrom(itemToUpdate); } var root = _domainRoot.GetRoot(); var xmlRoot = BuildXmlStructureForProject(root); _document.Save(xmlRoot, root.ProjectPath); }
public void SetModules(params IModule[] modules) { var root = _domainRoot.GetRoot(); if (root == null) { root = new Project(); _domainRoot.SetRoot(root); } root.ClearModules(); foreach (var module in modules) { root.AddModule(new Module(module)); } }