public void ShouldSaveProject() { //Arrange string projectName = "testProj"; string description = "desc123"; string company = "MBD VC"; string website = "http://mypage.com"; string startDate = "2019-03-01"; builder.SetHeader(projectName, description, company, website, startDate, 0, 656, 300, "2.8.9", "en_GB"); builder.AddDayType(0); builder.AddDayType(1); builder.AddDefaultWeek(); builder.AddDefaultTaskProperties(); builder.AddTestTasks(); //Act sut = BuildSut(); sut.Save(null); GantXMLOpen open = new GantXMLOpen(); open.Load(); //Assert Assert.AreEqual(projectName, open.myProject.ProjectName); Assert.AreEqual(description, open.myProject.Description); Assert.AreEqual(company, open.myProject.Organization); Assert.AreEqual(website, open.myProject.MyWebLink); }
private void testGanttProjectToolStripMenuItem_Click(object sender, EventArgs e) { GanttProject project = new GanttProject(); var xmlsXaver = new GanttXMLSaver(null, null, null, null, null); xmlsXaver.Save(null); }
public static GanttProjectResult Create(GanttProject ganttProject) => new GanttProjectResult { GanttProject = new GanttProjectDto { Content = ganttProject.Content, ProjectId = ganttProject.ProjectId, Id = ganttProject.Id } };
public void Load() { var filename = @"D:\Repos\GanttProjectDotNet\test.gan"; var doc = XDocument.Load(filename); myProject = new GanttProject(); area = new GanttGraphicArea(); myFacadeUI = new UIFacade(); myProject.ProjectName = doc.Root.GetAttribute(Constants.NameAttribute); myProject.Organization = doc.Root.GetAttribute(Constants.OrganizationAttribute); myProject.MyWebLink = doc.Root.GetAttribute(Constants.MyWebLinkAttribute); area.StartDate = doc.Root.GetAttribute(Constants.AreaStartDateAttribute); if (doc.Root.Attribute(Constants.MyFacadeUIViewIndexAttribute) != null) { myFacadeUI.ViewIndex = doc.Root.GetAttributeINT(Constants.MyFacadeUIViewIndexAttribute); } if (doc.Root.Attribute(Constants.MyFacadeUIGanttDividerLocationAttribute) != null) { myFacadeUI.GanttDividerLocation = doc.Root.GetAttributeINT(Constants.MyFacadeUIGanttDividerLocationAttribute); } if (doc.Root.Attribute(Constants.MyFacadeUIResourceDividerLocationAttribute) != null) { myFacadeUI.ResourceDividerLocation = doc.Root.GetAttributeINT(Constants.MyFacadeUIResourceDividerLocationAttribute); } VERSION = doc.Root.GetAttribute(Constants.VERSIONAttribute); LANGUAGE = doc.Root.GetAttribute(Constants.LANGUAGEAttribute); ////// See https://bugs.openjdk.java.net/browse/JDK-8133452 //if (!String.IsNullOrEmpty(myProject.Description)) // root.AddElement("description", myProject.Description, true); myProject.Description = doc.Root.Element(Constants.DescriptionElement).GetElementValue(Constants.DescriptionElement, true); //saveViews(handler); //emptyComment(handler); //saveCalendar(handler); //saveTasks(handler); //saveResources(handler); //saveAssignments(handler); //saveVacations(handler); //saveHistory(handler); //saveRoles(handler); //endElement("project", handler); //handler.endDocument(); //stream.close(); }
public GanttXMLSaver(GanttProject project, TaskTreeUIFacade taskTree, GanttResourcePanel peop, GanttGraphicArea area, UIFacade uIFacade) { this.area = area; myProject = project; }