public void ReferencedByAfterRemove() { EditableDataset dataset = CreateDatasetAndAddEntry(); dataset.Add(barPlugInEntry); // Both plug-ins reference the same lib (nunit.framework) List <string> libs = new List <string>(); libs.Add("nunit.framework"); AssertListsAreEqual(libs, dataset.ReferencedByEntries(libs)); dataset.Remove(fooPlugInEntry.Name); AssertListsAreEqual(libs, dataset.ReferencedByEntries(libs)); dataset.Remove(barPlugInEntry.Name); AssertListsAreEqual(new List <string>(), dataset.ReferencedByEntries(libs)); }
public void Create_Add_Remove() { EditableDataset dataset = CreateDatasetAndAddEntry(); IDatasetEntry removedEntry = dataset.Remove(fooPlugInEntry.Name); Assert.AreEqual(0, dataset.Count); Assert.IsNotNull(removedEntry); AssertEntriesAreEqual(fooPlugInEntry, removedEntry); IList <string> libs = fooPlugInEntry.ReferencedAssemblies; AssertListsAreEqual(new List <string>(), dataset.ReferencedByEntries(libs)); }
//--------------------------------------------------------------------- private EditableDataset CreateDatasetAndAddEntry() { EditableDataset dataset = EditableDataset.Create(); dataset.Add(fooPlugInEntry); Assert.AreEqual(1, dataset.Count); IList <string> libs = fooPlugInEntry.ReferencedAssemblies; AssertListsAreEqual(libs, dataset.ReferencedByEntries(libs)); IDatasetEntry foundEntry = dataset.Find(fooPlugInEntry.Name); Assert.IsNotNull(foundEntry); AssertEntriesAreEqual(fooPlugInEntry, foundEntry); return(dataset); }
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)); }