Beispiel #1
0
        public void ScssToCssTest()
        {
            var files = GetFiles();

            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(157);
            files = GetFiles();
            Assert.AreEqual(2, files.Length);
            Assert.IsTrue(File.Exists(File1));
            Assert.IsTrue(File.Exists(File2));
        }
Beispiel #2
0
 public void HttpPostTest()
 {
     // TODO
     //var files = GetFiles();
     //Assert.AreEqual(0, files.Length);
     Helper.StartWorkflow(100);
     //files = GetFiles();
     //Assert.AreEqual(2, files.Length);
     //Assert.IsTrue(File.Exists(File1));
     //Assert.IsTrue(File.Exists(File2));
 }
Beispiel #3
0
        public void TextsEncryptorTest()
        {
            var files = GetFiles(TextsEncryptorFolder);

            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(83);
            files = GetFiles(TextsEncryptorFolder);
            Assert.AreEqual(2, files.Length);
            files = GetFiles(TextsDecryptorSrcFolder);
            Assert.AreEqual(2, files.Length);
        }
Beispiel #4
0
        public void UglifyHtmlTest()
        {
            var files = GetFiles();

            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(165);
            files = GetFiles();
            Assert.AreEqual(2, files.Length);
            Assert.IsTrue(File.Exists(File1));
            Assert.IsTrue(File.Exists(File2));
        }
Beispiel #5
0
        public void FilesInfoTest()
        {
            string[] files = GetFiles();
            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(54);
            files = GetFiles();
            Assert.AreEqual(1, files.Length);
            string content = File.ReadAllText(files[0]);

            Assert.AreEqual(_expectedResult, content);
        }
Beispiel #6
0
        public void FilesLoaderTest()
        {
            Helper.StartWorkflow(3);

            // Check the workflow result
            string[] files = Directory.GetFiles(TempFolder, "ListFiles*.xml", SearchOption.AllDirectories);
            Assert.AreEqual(1, files.Length);

            string content = File.ReadAllText(files[0]);

            Assert.AreEqual(ExpectedResult, content);
        }
Beispiel #7
0
        public void ProcessInfoTest()
        {
            string[] files = GetFiles();
            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(63);
            files = GetFiles();
            Assert.AreEqual(1, files.Length);
            var xdoc  = XDocument.Load(files[0]);
            var count = xdoc.Descendants("Process").Count();

            Assert.AreEqual(1, count);
        }
Beispiel #8
0
        public void XsltTest()
        {
            var files = GetFiles();

            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(18);
            files = GetFiles();
            Assert.AreEqual(1, files.Length);
            string content = File.ReadAllText(files[0]);

            Assert.AreEqual(ExpectedResult, content);
        }
Beispiel #9
0
        public void FilesDiffTest()
        {
            Helper.StartWorkflow(155);

            // Check the workflow result
            string[] files = Directory.GetFiles(TempFolder, "FilesDiff*.diff", SearchOption.AllDirectories);
            Assert.AreEqual(files.Length, 1);

            string content = File.ReadAllText(files[0]);

            Assert.AreEqual(ExpectedResult, content);
        }
Beispiel #10
0
        public void PingTest()
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            Helper.StartWorkflow(94);
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 1000);
            stopwatch.Reset();
            stopwatch.Start();
            Helper.StartWorkflow(95);
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 2000);
        }
Beispiel #11
0
 public void XmlToCsvTest()
 {
     string[] files = GetCsvs();
     Assert.AreEqual(0, files.Length);
     Helper.StartWorkflow(17);
     files = GetCsvs();
     Assert.AreEqual(2, files.Length);
     foreach (var file in files)
     {
         string content = File.ReadAllText(file);
         Assert.AreEqual(ExpectedResult, content);
     }
 }
Beispiel #12
0
        public void FileExistsTest()
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            Helper.StartWorkflow(49);
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 1000);
            stopwatch.Reset();
            stopwatch.Start();
            Helper.StartWorkflow(50);
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 2000);
        }
Beispiel #13
0
        public void FileContentMatchTest()
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            Helper.StartWorkflow(126);
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 1000);
            stopwatch.Reset();
            stopwatch.Start();
            Helper.StartWorkflow(127);
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 2000);
        }
Beispiel #14
0
        public void CsvToXmlTest()
        {
            Helper.StartWorkflow(1);

            // Check the workflow result
            var xmlFiles = Directory.GetFiles(@"C:\WexflowTesting\CsvToXml\", "*.xml");

            Assert.AreEqual(2, xmlFiles.Length);

            foreach (var xmlFile in xmlFiles)
            {
                var xmlContent = File.ReadAllText(xmlFile);
                Assert.AreEqual(ExpectedResult, xmlContent);
            }
        }
Beispiel #15
0
        public void ImagesCropperTest()
        {
            Assert.AreEqual(false, File.Exists(Dest1));
            Assert.AreEqual(false, File.Exists(Dest2));
            Assert.AreEqual(false, File.Exists(Dest3));
            Helper.StartWorkflow(74);
            Assert.AreEqual(true, File.Exists(Dest1));
            Assert.AreEqual(true, File.Exists(Dest2));
            Assert.AreEqual(true, File.Exists(Dest3));

            // Checking the image size
            CheckImageSize(Dest1);
            CheckImageSize(Dest2);
            CheckImageSize(Dest3);
        }
Beispiel #16
0
        public void Execute(int workflowId, string expectedResult)
        {
            TestInitialize(workflowId);
            Helper.StartWorkflow(workflowId);

            // Check the workflow result
            string[] files = Directory.GetFiles(
                Path.Combine(Helper.TempFolder, workflowId.ToString()),
                "ListFiles*.xml",
                SearchOption.AllDirectories);
            Assert.AreEqual(1, files.Length);

            string content = File.ReadAllText(files[0]);

            Assert.AreEqual(expectedResult, content);
        }
Beispiel #17
0
        public void ImagesConcatTest()
        {
            var images = GetFiles();

            Assert.AreEqual(0, images.Length);
            Helper.StartWorkflow(77);
            images = GetFiles();
            Assert.AreEqual(1, images.Length);

            // Checking the image size
            using (Image image = Image.FromFile(images[0]))
            {
                Assert.AreEqual(3072, image.Width);
                Assert.AreEqual(768, image.Height);
            }
        }
Beispiel #18
0
        public void FtpTest()
        {
            Assert.IsFalse(File.Exists(File1));
            Assert.IsFalse(File.Exists(File2));
            var files = GetFiles();

            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(55); // list+upload+download+delete
            files = GetFiles();
            Assert.AreEqual(1, files.Length);
            var content = File.ReadAllText(files[0]);

            Assert.AreEqual(ExpectedResult, content);
            Assert.IsTrue(File.Exists(File1));
            Assert.IsTrue(File.Exists(File2));
            // TODO sftp and ftps
        }
Beispiel #19
0
        public void GuidTest()
        {
            string[] files = GetFiles();
            Assert.AreEqual(0, files.Length);
            Helper.StartWorkflow(68);
            files = GetFiles();
            Assert.AreEqual(1, files.Length);
            var xdoc   = XDocument.Load(files[0]);
            var xguids = xdoc.Descendants("Guid").ToList();

            Assert.AreEqual(3, xguids.Count);
            var regexPattern = @"^([0-9A-Fa-f]{8}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{4}[-][0-9A-Fa-f]{12})$";

            foreach (var xguid in xguids)
            {
                Assert.IsTrue(Regex.IsMatch(xguid.Value, regexPattern));
            }
        }
Beispiel #20
0
        public void SqlTest()
        {
            Helper.StartWorkflow(158);

            // sqlite
            const string sql = "select Id, Description from Data;";

            using (var conn = new SQLiteConnection(SqliteConnectionString))
            {
                var comm = new SQLiteCommand(sql, conn);
                conn.Open();
                using (var reader = comm.ExecuteReader())
                {
                    while (reader.Read())
                    {
                        int    id   = int.Parse(reader["Id"].ToString());
                        string desc = (string)reader["Description"];

                        if (id == 1)
                        {
                            Assert.AreEqual("Hello World Description 1! updated", desc);
                        }
                        else if (id == 2)
                        {
                            Assert.AreEqual("Hello World Description 2! updated", desc);
                        }
                        else if (id == 3)
                        {
                            Assert.AreEqual("Hello World Description 3! updated", desc);
                        }
                        else if (id == 4)
                        {
                            Assert.AreEqual("Hello World Description 4! updated", desc);
                        }
                        else if (id == 5)
                        {
                            Assert.AreEqual("Hello World Description 5!", desc);
                        }
                    }
                }
            }

            // TODO sqlserver|access|oracle|mysql|postgresql|teradata
        }
Beispiel #21
0
        public void ApprovalTest()
        {
            var workflowId = 131;
            var instanceId = Helper.StartWorkflow(workflowId);

            Thread.Sleep(500);
            Helper.ApproveWorkflow(workflowId, instanceId);
            Stopwatch stopwatch = Stopwatch.StartNew();
            var       workflow  = Helper.GetWorkflow(workflowId);
            var       isRunning = workflow.IsRunning;

            while (isRunning)
            {
                Thread.Sleep(100);
                workflow  = Helper.GetWorkflow(workflowId);
                isRunning = workflow.IsRunning;
            }
            stopwatch.Stop();
            Assert.IsTrue(stopwatch.ElapsedMilliseconds > 2000);
        }
Beispiel #22
0
        public void EnvironmentVariableTest()
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            Helper.StartWorkflow(116);
            stopwatch.Stop();

            string varValue = Environment.GetEnvironmentVariable("OS");

            switch (varValue)
            {
            case "Windows_NT":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 1000);
                break;

            default:
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 2000);
                break;
            }
        }
Beispiel #23
0
        public void NowTest()
        {
            Stopwatch stopwatch = Stopwatch.StartNew();

            Helper.StartWorkflow(51);
            stopwatch.Stop();

            string day = string.Format(new CultureInfo("en-US"), "{0:dddd}", DateTime.Now);

            switch (day)
            {
            case "Monday":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 1000 && stopwatch.ElapsedMilliseconds < 2000);
                break;

            case "Tuesday":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 2000 && stopwatch.ElapsedMilliseconds < 3000);
                break;

            case "Wednesday":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 3000 && stopwatch.ElapsedMilliseconds < 4000);
                break;

            case "Thursday":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 4000 && stopwatch.ElapsedMilliseconds < 5000);
                break;

            case "Friday":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 5000 && stopwatch.ElapsedMilliseconds < 6000);
                break;

            case "Saturday":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 6000 && stopwatch.ElapsedMilliseconds < 7000);
                break;

            case "Sunday":
                Assert.IsTrue(stopwatch.ElapsedMilliseconds > 7000);
                break;
            }
        }
Beispiel #24
0
        public void FilesJoinerTest()
        {
            var files = Directory.GetFiles(SourceFilesFolder);

            Assert.AreEqual(16, files.Length);

            Helper.StartWorkflow(147);

            files = Directory.GetFiles(TempFolder, "*", SearchOption.AllDirectories).OrderBy(f => f).ToArray();
            Assert.AreEqual(4, files.Length);

            var content = File.ReadAllText(files[0]);

            Assert.AreEqual(ExpectedResultFileA, content);

            content = File.ReadAllText(files[1]);
            Assert.AreEqual(ExpectedResultFileB, content);

            content = File.ReadAllText(files[2]);
            Assert.AreEqual(ExpectedResultFileC, content);

            content = File.ReadAllText(files[3]);
            Assert.AreEqual(ExpectedResultFileD, content);
        }
Beispiel #25
0
 public void CsvToSqlTest()
 {
     // TODO
     Helper.StartWorkflow(152);
 }
Beispiel #26
0
 public void FilesRenamerTest()
 {
     Assert.AreEqual(false, File.Exists(SrcRenamed));
     Helper.StartWorkflow(36);
     Assert.AreEqual(true, File.Exists(SrcRenamed));
 }
Beispiel #27
0
 public void ZipTest()
 {
     Assert.AreEqual(false, File.Exists(ZipFile));
     Helper.StartWorkflow(19);
     Assert.AreEqual(true, File.Exists(ZipFile));
 }
Beispiel #28
0
 public void RedditTest()
 {
     Helper.StartWorkflow(130);
     // TODO
 }
Beispiel #29
0
 public void VimeoTest()
 {
     // TODO
     Helper.StartWorkflow(136);
 }
Beispiel #30
0
 public void HttpPatchTest()
 {
     Helper.StartWorkflow(102);
     // TODO
 }