public void FindLogFileParserTest()
        {
            PluginFactory.Reset();
            PluginFactory.LoadPlugins(pluginPath);

            IParserFactory lfp = PluginFactory.FindLogFileParser("dummy.csv");

            IsTypenameSame(lfp.GetType(), typeof(Sample_Crunch.StandardPanels.CsvParserFactory));
        }
        public void FindParserTest()
        {
            PluginFactory.Reset();
            PluginFactory.LoadPlugins(pluginPath);
            Type           factoryType = typeof(Sample_Crunch.StandardPanels.CsvParserFactory);
            IParserFactory lfp         = PluginFactory.FindParser(factoryType.FullName);

            IsTypenameSame(lfp.GetType(), factoryType);
        }
        public void FindPanelFactoryTest()
        {
            PluginFactory.Reset();
            PluginFactory.LoadPlugins(pluginPath);
            Type          factoryType = typeof(Sample_Crunch.StandardPanels.TimePlotFactory);
            var           factory     = PluginFactory.CreatePanelFactory(factoryType);
            var           model       = factory.CreateModel();
            IPanelFactory lfp         = PluginFactory.FindPanelFactory(model);

            IsTypenameSame(lfp.GetType(), factoryType);
        }
Exemple #4
0
        public void SaveAndOpenFailures()
        {
            PluginFactory.Reset();
            PluginFactory.LoadPlugins(pluginPath);
            Assert.IsFalse(File.Exists(filename), "Project file should not exist");
            ProjectData testProj = new ProjectData();

            testProj.Files.Add(new FileModel());
            testProj.Save(filename);

            Assert.IsTrue(File.Exists(filename), "No project file written");
            ProjectData openedProj = ProjectData.Open(filename); // Should fail since there is no file in filetopic

            ProjectViewModel projVM = new ProjectViewModel(openedProj);
        }
        public void ResetTest()
        {
            LoadPluginsTest();

            var expectedInfo    = PluginFactory.Info;
            var expectedParsers = PluginFactory.ParserFactories;
            var expectedPanels  = PluginFactory.PanelFactories;

            PluginFactory.Reset();

            Assert.IsTrue(PluginFactory.Info.Count == 0, "Expected info to be empty after reset");
            Assert.IsTrue(PluginFactory.ParserFactories.Count == 0, "Expected Parsers to be empty after reset");
            Assert.IsTrue(PluginFactory.PanelFactories.Count == 0, "Expected Panels to be empty after reset");

            LoadPluginsTest();

            CollectionAssert.AreEqual(expectedInfo, PluginFactory.Info);
            CollectionAssert.AreEqual(expectedParsers, PluginFactory.ParserFactories);
            CollectionAssert.AreEqual(expectedPanels, PluginFactory.PanelFactories);
        }
 public void TestCleanup()
 {
     PluginFactory.Reset();
 }