예제 #1
0
        public void GetDefaultCodeBasePathShouldReturnNullIfTestCaseListIsEmpty()
        {
            var tests = new List <TestCase>();

            var defaultCodeBase = TestSourcesUtility.GetDefaultCodebasePath(tests);

            Assert.IsNull(defaultCodeBase);
        }
예제 #2
0
        public void GetDefaultCodeBasePathShouldReturnNullIfAdapterSourceMapIsEmpty()
        {
            var adapterSourceMap = new Dictionary <string, IEnumerable <string> >();

            var defaultCodeBase = TestSourcesUtility.GetDefaultCodebasePath(adapterSourceMap);

            Assert.IsNull(defaultCodeBase);
        }
예제 #3
0
        public void GetDefaultCodeBasePathShouldReturnDefaultDirectoryPathForTestCaseList()
        {
            var tests = new List <TestCase>()
            {
                new TestCase("test1", new Uri(Path.Combine(temp, "d")), Path.Combine(temp, "folder1", "source1.dll"))
            };

            var defaultCodeBase = TestSourcesUtility.GetDefaultCodebasePath(tests);

            Assert.AreEqual(Path.Combine(temp, "folder1"), defaultCodeBase);
        }
        public void GetDefaultCodeBasePathShouldReturnDefaultDirectoryPathForTestCaseList()
        {
            var tests = new List <TestCase>()
            {
                new TestCase("test1", new Uri("e://d"), "c:\\folder1\\source1.dll")
            };

            var defaultCodeBase = TestSourcesUtility.GetDefaultCodebasePath(tests);

            Assert.AreEqual("c:\\folder1", defaultCodeBase);
        }
예제 #5
0
        public void GetDefaultCodeBasePathShouldReturnDefaultDirectoryPathForAdapterSourceMap()
        {
            var adapterSourceMap = new Dictionary <string, IEnumerable <string> >();

            adapterSourceMap.Add("adapter1", new List <string>()
            {
                Path.Combine(temp, "folder1", "source1.dll"), Path.Combine(temp, "folder2", "source2.dll")
            });

            var defaultCodeBase = TestSourcesUtility.GetDefaultCodebasePath(adapterSourceMap);

            Assert.AreEqual(Path.Combine(temp, "folder1"), defaultCodeBase);
        }
예제 #6
0
        public void GetDefaultCodeBasePathShouldReturnDefaultDirectoryPathForAdapterSourceMap()
        {
            var adapterSourceMap = new Dictionary <string, IEnumerable <string> >();

            adapterSourceMap.Add("adapter1", new List <string>()
            {
                "c:\\folder1\\source1.dll", "c:\\folder2\\source2.dll"
            });

            var defaultCodeBase = TestSourcesUtility.GetDefaultCodebasePath(adapterSourceMap);

            Assert.AreEqual(defaultCodeBase, "c:\\folder1");
        }
예제 #7
0
        /// <summary>
        /// Starts the test run
        /// </summary>
        /// <param name="adapterSourceMap"> The adapter Source Map.  </param>
        /// <param name="package">The user input test source(package) if it differ from actual test source otherwise null.</param>
        /// <param name="runSettings"> The run Settings.  </param>
        /// <param name="testExecutionContext"> The test Execution Context. </param>
        /// <param name="testCaseEventsHandler"> EventHandler for handling test cases level events from Engine. </param>
        /// <param name="runEventsHandler"> EventHandler for handling execution events from Engine.  </param>
        public void StartTestRun(
            Dictionary <string, IEnumerable <string> > adapterSourceMap,
            string package,
            string runSettings,
            TestExecutionContext testExecutionContext,
            ITestCaseEventsHandler testCaseEventsHandler,
            ITestRunEventsHandler runEventsHandler)
        {
            try
            {
                this.InitializeDataCollectors(runSettings, testCaseEventsHandler as ITestEventsPublisher, TestSourcesUtility.GetDefaultCodebasePath(adapterSourceMap));

                this.activeTestRun = new RunTestsWithSources(this.requestData, adapterSourceMap, package, runSettings, testExecutionContext, testCaseEventsHandler, runEventsHandler);

                this.activeTestRun.RunTests();
            }
            catch (Exception e)
            {
                runEventsHandler.HandleLogMessage(TestMessageLevel.Error, e.ToString());
                this.Abort(runEventsHandler);
            }
            finally
            {
                this.activeTestRun = null;
            }
        }