public void CheckCorrectAddElement() { var xmlCreator = new XmlCreator(); xmlCreator.AddToRoot(new XElement("test", "value")); Assert.AreEqual(1, xmlCreator.Document.Elements("fet").Elements("test").Count()); }
public void CheckCorrectAddElementArray() { var xmlCreator = new XmlCreator(); var list = new List <XElement> { new XElement("test", "value"), new XElement("test", "value2") }; xmlCreator.AddToRoot(list.ToArray()); Assert.AreEqual(2, xmlCreator.Document.Elements("fet").Elements("test").Count()); }
/// <summary> /// Generates a .FET file for use in the algorithm. /// </summary> /// <param name="outputDir">Output directory for the FET file.</param> /// <returns>Filename of the generated .FET file.</returns> public string GenerateFetFile(string outputDir) { // Init XML creator var xmlCreator = new XmlCreator(FetVersion); // Create FET file xmlCreator.AddToRoot(DaysList.Create()); xmlCreator.AddToRoot(HoursList.Create()); xmlCreator.AddToRoot(TeachersList.Create()); xmlCreator.AddToRoot(SubjectsList.Create()); xmlCreator.AddToRoot(YearsList.Create()); xmlCreator.AddToRoot(ActivitiesList.Create()); xmlCreator.AddToRoot(TimeConstraintsList.Create()); xmlCreator.AddToRoot(SpaceConstraintsList.Create()); xmlCreator.AddToRoot(RoomsList.Create()); return(xmlCreator.Save(outputDir)); }