コード例 #1
0
        /// <summary>
        /// Sends Session-Start event on in-proc datacollectors
        /// </summary>
        protected override void SendSessionStart()
        {
            // Send session start with test sources in property bag for session start event args.
            if (this.testCaseEventsHandler == null)
            {
                return;
            }

            var properties = new Dictionary <string, object>();

            properties.Add("TestSources", TestSourcesUtility.GetSources(this.testCases));

            this.testCaseEventsHandler.SendSessionStart(properties);
        }
コード例 #2
0
        public void GetSourcesShouldGetDistinctSourcesFromTestCases()
        {
            var tests = new List <TestCase>()
            {
                new TestCase("test1", new Uri("e://d"), "source1.dll"),
                new TestCase("test2", new Uri("e://d"), "source2.dll"),
                new TestCase("test3", new Uri("e://d"), "source1.dll")
            };

            var sources = TestSourcesUtility.GetSources(tests);

            Assert.AreEqual(2, sources.Count());
            Assert.IsTrue(sources.Contains("source1.dll"));
            Assert.IsTrue(sources.Contains("source2.dll"));
        }
コード例 #3
0
        public void GetSourcesShouldAggregateSourcesIfMultiplePresentInAdapterSourceMap()
        {
            var adapterSourceMap = new Dictionary <string, IEnumerable <string> >();

            adapterSourceMap.Add("adapter1", new List <string>()
            {
                "source1.dll", "source2.dll"
            });
            adapterSourceMap.Add("adapter2", new List <string>()
            {
                "source1.dll", "source3.dll"
            });
            adapterSourceMap.Add("adapter3", new List <string>()
            {
                "source1.dll"
            });

            var sources = TestSourcesUtility.GetSources(adapterSourceMap);

            Assert.AreEqual(5, sources.Count());
            Assert.IsTrue(sources.Contains("source1.dll"));
            Assert.IsTrue(sources.Contains("source2.dll"));
            Assert.IsTrue(sources.Contains("source3.dll"));
        }
コード例 #4
0
 /// <summary>
 /// Gets test sources from test run criteria
 /// </summary>
 /// <returns>test sources</returns>
 private IEnumerable <string> GetSourcesFromTestRunCriteria(TestRunCriteria testRunCriteria)
 {
     return(testRunCriteria.HasSpecificTests ? TestSourcesUtility.GetSources(testRunCriteria.Tests) : testRunCriteria.Sources);
 }