Esempio n. 1
0
        public void TestSkylineRunnerArgs()
        {
            const string skyFile   = @"C:\Dummy\path\Test_file.sky";
            const string dataFile1 = @"C:\Dummy\path\Test1.raw";

            var mainSettings = new MainSettings(skyFile, "", false, null, true,
                                                MainSettings.ACCUM_TIME_WINDOW, "Thermo", MainSettings.ACQUISITION_TIME);

            var accumulationWindow = AccumulationWindow.Get(DateTime.Now, MainSettings.ACCUM_TIME_WINDOW);

            Assert.AreEqual(accumulationWindow.EndDate.Subtract(accumulationWindow.StartDate).Days + 1,
                            MainSettings.ACCUM_TIME_WINDOW);

            var expected =
                string.Format("--in=\"{0}\" --remove-before={1} --import-file=\"{3}\" --import-on-or-after={2} --save", skyFile,
                              accumulationWindow.StartDate.ToShortDateString(),
                              accumulationWindow.StartDate.ToShortDateString(), dataFile1);

            var importContext = new ImportContext(dataFile1);

            Assert.IsFalse(importContext.ImportExisting);

            var args = mainSettings.SkylineRunnerArgs(importContext);

            Assert.AreEqual(expected, args.Trim());
        }
Esempio n. 2
0
        public void TestSkylineRunnerArgsImportExisting()
        {
            const string skyFile   = @"C:\Dummy\path\Test_file.sky";
            const string dataFile1 = @"C:\Dummy\path\Test1.raw";
            const string dataFile2 = @"C:\Dummy\path\Test2.raw";

            var mainSettings = new MainSettings(skyFile, "", false, null, true,
                                                MainSettings.ACCUM_TIME_WINDOW, "Thermo", MainSettings.ACQUISITION_TIME);

            // Create an import context.
            var importContext = new ImportContext(new List <string>()
            {
                dataFile1, dataFile2
            });

            Assert.IsTrue(importContext.ImportExisting);

            // Arguments for the first file.
            var expected =
                string.Format("--in=\"{0}\" --import-file=\"{1}\" --save", skyFile, dataFile1);

            importContext.GetNextFile();
            var args = mainSettings.SkylineRunnerArgs(importContext);

            Assert.AreEqual(expected, args.Trim());

            // Arguments for the second file
            importContext.GetNextFile();
            Assert.IsTrue(importContext.ImportingLast());
            expected =
                string.Format("--in=\"{0}\" --import-file=\"{1}\" --save", skyFile, dataFile2);

            args = mainSettings.SkylineRunnerArgs(importContext);
            Assert.AreEqual(expected, args.Trim());

            Assert.IsNull(importContext.GetNextFile());
        }