Example #1
0
        public void TestAddArchiveArgs()
        {
            var mainSettings = new MainSettings()
            {
                SkylineFilePath = @"C:\Dummy\path\Test_file.sky"
            };
            var date = new DateTime(2015, 6, 17);

            mainSettings.LastArchivalDate = date;

            var args = mainSettings.GetArchiveArgs(mainSettings.LastArchivalDate, date);

            Assert.IsNull(args);
            Assert.AreEqual(date, mainSettings.LastArchivalDate);

            date = date.AddMonths(1); // 07/17/2015
            var archiveArg = string.Format("--share-zip={0}", "Test_file_2015_06.sky.zip");

            args = mainSettings.GetArchiveArgs(mainSettings.LastArchivalDate, date);
            Assert.AreEqual(archiveArg, args);
            Assert.AreEqual(date, mainSettings.LastArchivalDate);

            date       = date.AddYears(1); // 06/17/2016
            archiveArg = string.Format("--share-zip={0}", "Test_file_2015_07.sky.zip");
            args       = mainSettings.GetArchiveArgs(mainSettings.LastArchivalDate, date);
            Assert.AreEqual(archiveArg, args);
            Assert.AreEqual(date, mainSettings.LastArchivalDate);
        }
Example #2
0
        public void TestAddArchiveArgs()
        {
            var mainSettings = new MainSettings(@"C:\Dummy\path\Test_file.sky", "", false, null, true,
                                                MainSettings.ACCUM_TIME_WINDOW, "Thermo", MainSettings.ACQUISITION_TIME);
            var date = new DateTime(2015, 6, 17);

            mainSettings.LastArchivalDate = date;

            var args = mainSettings.GetArchiveArgs(mainSettings.LastArchivalDate, date);

            Assert.IsNull(args);
            Assert.AreEqual(date, mainSettings.LastArchivalDate);

            date = date.AddMonths(1); // 07/17/2015
            var archiveArg = string.Format("--share-zip={0}", "Test_file_2015_06.sky.zip");

            args = mainSettings.GetArchiveArgs(mainSettings.LastArchivalDate, date);
            Assert.AreEqual(archiveArg, args);
            Assert.AreEqual(date, mainSettings.LastArchivalDate);

            date       = date.AddYears(1); // 06/17/2016
            archiveArg = string.Format("--share-zip={0}", "Test_file_2015_07.sky.zip");
            args       = mainSettings.GetArchiveArgs(mainSettings.LastArchivalDate, date);
            Assert.AreEqual(archiveArg, args);
            Assert.AreEqual(date, mainSettings.LastArchivalDate);
        }