Beispiel #1
0
        public void DelayTestCaseTest()
        {
            DeleteFiles();
            int stepDelayDuration = 500;
            var step = new DelayStep();
            step.DelayMilliSeconds = stepDelayDuration;

            var sw = new Stopwatch();
            sw.Start();

            step.Execute(new Context());

            var actualDuration = sw.ElapsedMilliseconds;
            Console.WriteLine("Observed delay: {0}", actualDuration);
            Assert.AreEqual(stepDelayDuration, actualDuration, 20);

            stepDelayDuration = 5;
            step.DelayMilliSeconds = stepDelayDuration;

            var tc = new TestCase();
            tc.ExecutionSteps.Add(step);

            TestCase.SaveToFile(tc, "DelayTestCaseTest.xaml");
            var bu = new BizUnit(TestCase.LoadFromFile("DelayTestCaseTest.xaml"));

            sw = new Stopwatch();
            sw.Start();

            bu.RunTest();

            actualDuration = sw.ElapsedMilliseconds;
            Console.WriteLine("Observed delay: {0}", actualDuration);
            Assert.AreEqual(actualDuration, stepDelayDuration, 20);
        }
Beispiel #2
0
        public void DelayTest()
        {
            int stepDelayDuration = 500;
            var step = new DelayStep();
            step.DelayMilliSeconds = stepDelayDuration;

            var sw = new Stopwatch();
            sw.Start();

            step.Execute(new Context());

            var actualDuration = sw.ElapsedMilliseconds;
            Console.WriteLine("Observed delay: {0}", actualDuration);
            Assert.AreEqual(stepDelayDuration, actualDuration, 20);

            stepDelayDuration = 5;
            step.DelayMilliSeconds = stepDelayDuration;

            sw = new Stopwatch();
            sw.Start();

            step.Execute(new Context());

            actualDuration = sw.ElapsedMilliseconds;
            Console.WriteLine("Observed delay: {0}", actualDuration);
            Assert.AreEqual(actualDuration, stepDelayDuration, 20);
        }
Beispiel #3
0
        public void SerializationV4TestStepsOnly()
        {
            var btc = new TestCase();
            btc.Name = "Serialization Test";

            var fm = new DelayStep();
            fm.DelayMilliSeconds = 35;
            btc.SetupSteps.Add(fm);

            string testCase = TestCase.Save(btc);
            var btcNew = TestCase.LoadXaml(testCase);
        }
Beispiel #4
0
        public void ExecuteTestCase()
        {
            var btc = new TestCase();
            btc.Name = "Serialization Test";
            btc.Description = "Test to blah blah blah, yeah really!";
            btc.BizUnitVersion = "4.0.0.1";

            var fm = new DelayStep {DelayMilliSeconds = 35};
            btc.SetupSteps.Add(fm);

            var bu = new BizUnit(btc);
            bu.RunTest();
        }
Beispiel #5
0
        public void DelaySampleTest()
        {
            DeleteFiles();

            // Create the test case
            var testCase = new TestCase();

            // Create test steps...
            var delayStep = new DelayStep {DelayMilliSeconds = 500};

            // Add test steps to the required test stage
            testCase.ExecutionSteps.Add(delayStep);

            // Create a new instance of BizUnit and run the test
            var bizUnit = new BizUnit(testCase);
            bizUnit.RunTest();

            // Save Test Case
            TestCase.SaveToFile(testCase, "DelaySampleTest.xaml");
        }