Пример #1
0
        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));
        }
Пример #2
0
        //---------------------------------------------------------------------

        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);
        }
Пример #3
0
        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));
        }
Пример #4
0
        public void AddNull()
        {
            EditableDataset dataset = EditableDataset.Create();

            dataset.Add(null);
        }