Example #1
0
        public void AppendCopyOfTestCaseSampleProjectTest()
        {
            TestCasesRoot tcr = new TestCasesRoot();

            tcr.CreateSampleProject();
            TestUtils.CheckTestCasesAndConditionsAndActions(tcr);
            int testCasesCount = tcr.TestCases.Count;

            for (int tcIdx = 0; tcIdx < testCasesCount; tcIdx++)
            {
                TestCase newTestCase      = tcr.InsertTestCase();
                TestCase templateTestCase = tcr.TestCases[tcIdx];
                tcr.CopyTestCaseSettings(templateTestCase, newTestCase);
            }

            // create and save the sample project
            string savePath = Path.Combine(TestSupport.CreatedFilesDirectory, "SimpleProject.dtc");

            tcr.Save(savePath);
            ProcessStartInfo info = new ProcessStartInfo(@"C:\Program Files (x86)\Notepad++\notepad++.exe", savePath);

            Process.Start(info);

            for (int tcIdx = 0; tcIdx < testCasesCount; tcIdx++)
            {
                CompareTestCases(tcr, tcIdx, tcIdx + testCasesCount);
            }
        }
Example #2
0
        public void ClearAllFieldsOnNewTest()
        {
            TestCasesRoot testCasesRoot = new TestCasesRoot();

            testCasesRoot.CreateSampleProject();

            // create and save the sample project
            string savePath = Path.Combine(TestSupport.CreatedFilesDirectory, "SampleProject.dtc");

            testCasesRoot.Save(savePath);
            //ProcessStartInfo info = new ProcessStartInfo(@"C:\Program Files (x86)\Notepad++\notepad++.exe", savePath);
            //Process.Start(info);

            testCasesRoot.New();
            savePath = Path.Combine(TestSupport.CreatedFilesDirectory, "EmptyProject.dtc");
            testCasesRoot.Save(savePath);
            //ProcessStartInfo info = new ProcessStartInfo(@"C:\Program Files (x86)\Notepad++\notepad++.exe", savePath);
            //Process.Start(info);

            Assert.That(testCasesRoot.Description == String.Empty);
            Assert.That(testCasesRoot.Actions != null && testCasesRoot.Actions.Count == 0);
            Assert.That(testCasesRoot.Conditions != null && testCasesRoot.Conditions.Count == 0);
            Assert.That(testCasesRoot.TestCases != null && testCasesRoot.TestCases.Count == 0);
        }