public void SaveAs_Load_Save_Load() { EditableDataset dataset = CreateDatasetAndAddEntry(); string filename = Data.MakeOutputPath("SaveAs_Load_Save_Load.landis"); dataset.SaveAs(filename); dataset = null; EditableDataset loadedDataset = EditableDataset.Load(filename); Assert.IsNotNull(loadedDataset); Assert.AreEqual(1, loadedDataset.Count); loadedDataset.Add(barPlugInEntry); Assert.AreEqual(2, loadedDataset.Count); loadedDataset.Save(); loadedDataset = null; EditableDataset reloadedDataset = EditableDataset.Load(filename); Assert.AreEqual(2, reloadedDataset.Count); AssertEntriesAreEqual(fooPlugInEntry, reloadedDataset.Find(fooPlugInEntry.Name)); AssertEntriesAreEqual(barPlugInEntry, reloadedDataset.Find(barPlugInEntry.Name)); }
//--------------------------------------------------------------------- private void TryLoad(string path) { try { path = Data.MakeInputPath(path); Data.Output.WriteLine("Loading plug-in dataset from \"{0}\" ...", path.Replace(Data.Directory, Data.DirPlaceholder)); EditableDataset dataset = EditableDataset.Load(path); } catch (System.Exception exc) { Data.Output.WriteLine(" {0}", exc.Message); Data.Output.WriteLine(); throw; } }
public void SaveAs_Load() { EditableDataset dataset = CreateDatasetAndAddEntry(); string filename = Data.MakeOutputPath("SaveAs_Load.landis"); dataset.SaveAs(filename); dataset = null; EditableDataset loadedDataset = EditableDataset.Load(filename); Assert.IsNotNull(loadedDataset); Assert.AreEqual(1, loadedDataset.Count); AssertEntriesAreEqual(fooPlugInEntry, loadedDataset[0]); IList <string> libs = fooPlugInEntry.ReferencedAssemblies; AssertListsAreEqual(libs, loadedDataset.ReferencedByEntries(libs)); }