Ejemplo n.º 1
0
        public void CreateParserFactoryTest()
        {
            Type           expect = typeof(Sample_Crunch.StandardPanels.CsvParserFactory);
            IParserFactory lfp    = PluginFactory.CreateParserFactory(expect);

            Assert.IsInstanceOfType(lfp, expect);
        }
Ejemplo n.º 2
0
        public void SaveAndOpenCSV()
        {
            SimpleIoc.Default.Register <Mock.MockMainViewModel>();
            //SimpleIoc.Default.Register<TelemetryClient>(()=> new TelemetryClient());
            ProjectData      testProj = new ProjectData();
            ProjectViewModel projVM   = new ProjectViewModel(testProj);
            IParserFactory   lfp      = PluginFactory.CreateParserFactory(typeof(CsvParserFactory));

            testProj.Files.Add(MockAddFile(@"TestData/data.csv", lfp));
            testProj.Save(filename);
            Assert.IsTrue(File.Exists(filename), "No project file written"); // Extension should be added by save

            ProjectData openedProj = ProjectData.Open(filename);

            Assert.AreEqual <int>(testProj.Files.Count, openedProj.Files.Count, "Invalid number of files");
        }