/// <summary> /// The following helper method is used to create the data in the xml persistenc store. /// </summary> private string SavePeople() { //Local variables. string path = AppDomain.CurrentDomain.BaseDirectory; string fileLoad = path + @"\LocalData\FileStructure.txt"; string fileSave = path + @"\LocalData\Demo.xml"; //Setup Test PersonRepository_XML_Persistence dataStrategy = new PersonRepository_XML_Persistence(fileSave); var people = PersonHelpers.ParsePersonDataFromFile(fileLoad); //Conduct Test Experiment. dataStrategy.ClearPeople(); var results = dataStrategy.SavePeople(people); //Return results. return(results); }
/// <summary> /// The following helper method is used to clear out the xml persistence store. /// </summary> private void ClearPeople() { //Local variables. string path = AppDomain.CurrentDomain.BaseDirectory; string fileLoad = path + @"\LocalData\FileStructure.txt"; string fileSave = path + @"\LocalData\Demo.xml"; //Setup Test PersonRepository_XML_Persistence dataStrategy = new PersonRepository_XML_Persistence(fileSave); var people = PersonHelpers.ParsePersonDataFromFile(fileLoad); //Conduct Test Experiment. try { dataStrategy.ClearPeople(); } catch { //Do nothing... This is just clearing the data. } }