示例#1
0
        public void GetJobb_EmptyDirectory_Test()
        {
            const string expectedName      = "TestJobb";
            const Period expectedPeriod    = Period.Seconds;
            const int    expectedUnit      = 5;
            const string expectedTargetDir = "C:/Test2";

            var    jobb            = (EmptyDirectoryJobb)JobbFactory.GetJobb(JobbType.EmptyDirectory, "TestJobb", "Seconds", "5", "C:/Test2");
            string actualName      = jobb.Parameters.Name;
            var    actualPeriod    = jobb.Parameters.Schedule.Period;
            int    actualUnit      = jobb.Parameters.Schedule.Unit;
            string actualTargetDir = jobb.Parameters.TargetDirectory;

            Assert.AreEqual(expectedName, actualName);
            Assert.AreEqual(expectedPeriod, actualPeriod);
            Assert.AreEqual(expectedUnit, actualUnit);
            Assert.AreEqual(expectedTargetDir, actualTargetDir);
        }
示例#2
0
        public void GetJobb_CopyFile_Test()
        {
            const string expectedName      = "TestJobb";
            const Period expectedPeriod    = Period.Seconds;
            const int    expectedUnit      = 5;
            const string expectedSourceDir = "C:/Test";
            const string expectedTargetDir = "C:/Test2";
            const string expectedFileName  = "NewFile.txt";

            var    jobb            = (CopyFileJobb)JobbFactory.GetJobb(JobbType.CopyFile, "TestJobb", "Seconds", "5", "C:/Test", "C:/Test2", "NewFile.txt");
            string actualName      = jobb.Parameters.Name;
            var    actualPeriod    = jobb.Parameters.Schedule.Period;
            int    actualUnit      = jobb.Parameters.Schedule.Unit;
            string actualSourceDir = jobb.Parameters.SourceDirectory;
            string actualTargetDir = jobb.Parameters.TargetDirectory;
            string actualFileName  = jobb.Parameters.FileName;

            Assert.AreEqual(expectedName, actualName);
            Assert.AreEqual(expectedPeriod, actualPeriod);
            Assert.AreEqual(expectedUnit, actualUnit);
            Assert.AreEqual(expectedSourceDir, actualSourceDir);
            Assert.AreEqual(expectedTargetDir, actualTargetDir);
            Assert.AreEqual(expectedFileName, actualFileName);
        }