• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MessageConsumers.TestRunInfo类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中AutoTest.Core.Messaging.MessageConsumers.TestRunInfo的典型用法代码示例。如果您正苦于以下问题:C# TestRunInfo类的具体用法?C# TestRunInfo怎么用?C# TestRunInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



TestRunInfo类属于AutoTest.Core.Messaging.MessageConsumers命名空间,在下文中一共展示了TestRunInfo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: getTestResults

		private TestRunResults getTestResults(TestRunInfo runInfo)
		{
			string project = "";
			if (runInfo.Project != null)
				project = runInfo.Project.Key;
			return new TestRunResults(project, runInfo.Assembly, _result.ToArray());
		}
开发者ID:jstclair,项目名称:AutoTest.Net,代码行数:7,代码来源:NUnitTestResponseParser.cs


示例2: RunTests

        public TestRunResults[] RunTests(TestRunInfo[] runInfos, Func<bool> abortWhen)
        {
			var results = new List<TestRunResults>();
			// Get a list of the various nunit executables specified pr. framework version
			var nUnitExes = getNUnitExes(runInfos);
			foreach (var nUnitExe in nUnitExes)
			{
				// Get the assemblies that should be run under this nunit executable
				string tests;
				var assemblies = getAssembliesAndTestsForTestRunner(nUnitExe.Exe, runInfos, out tests);
                if (assemblies == null)
                    continue;
				var arguments = getExecutableArguments(nUnitExe, assemblies, tests, runInfos);
                DebugLog.Debug.WriteInfo("Running tests: {0} {1}", nUnitExe.Exe, arguments); 
	            var proc = new Process();
	            proc.StartInfo = new ProcessStartInfo(nUnitExe.Exe, arguments);
	            proc.StartInfo.RedirectStandardOutput = true;
	            //proc.StartInfo.WorkingDirectory = Path.GetDirectoryName(runInfo.Assembly);
	            proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
	            proc.StartInfo.UseShellExecute = false;
	            proc.StartInfo.CreateNoWindow = true;
	
	            proc.Start();
	            var parser = new NUnitTestResponseParser(_bus, TestRunner.NUnit);
                var nUnitResult = getNUnitOutput(proc.StandardOutput);
			    parser.Parse(nUnitResult, runInfos, containsTests(arguments));
				foreach (var result in parser.Result)
		            results.Add(result);
			}
			return results.ToArray();
        }
开发者ID:jeremywiebe,项目名称:AutoTest.Net,代码行数:31,代码来源:NUnitTestRunner.cs


示例3: Should_locate_removed_test_in_partial_test_run

        public void Should_locate_removed_test_in_partial_test_run()
        {
            int i = 3;
            var results = new TestRunResults("project1", "assembly", false, new TestResult[]
                                                    {
                                                        new TestResult(TestRunner.NUnit, TestRunStatus.Failed, "Test1"),
                                                        new TestResult(TestRunner.NUnit, TestRunStatus.Ignored, "Test2"),
                                                        new TestResult(TestRunner.NUnit, TestRunStatus.Failed, "Test3"),
                                                        new TestResult(TestRunner.NUnit, TestRunStatus.Failed, "Test4")
                                                    });
            var cache = new RunResultCache();
            cache.Merge(results);

            var infos = new TestRunInfo[] { new TestRunInfo(new Project("project", new ProjectDocument(ProjectType.CSharp)), "assembly") };
            infos[0].AddTestsToRun(new TestToRun[] { new TestToRun(TestRunner.NUnit, "Test1"), new TestToRun(TestRunner.NUnit, "Test2"), new TestToRun(TestRunner.NUnit, "Test3") });
            results = new TestRunResults("project1", "assembly", true, new TestResult[]
                                                    {
                                                        new TestResult(TestRunner.NUnit, TestRunStatus.Ignored, "Test1")
                                                    });

            var locator = new RemovedTestsLocator(cache);
            results = locator.SetRemovedTestsAsPassed(results, infos);

            results.Passed.Length.ShouldEqual(2);
            results.Passed[0].Name.ShouldEqual("Test3");
            results.Passed[1].Name.ShouldEqual("Test2");
        }
开发者ID:zinark,项目名称:AutoTest.Net,代码行数:27,代码来源:RemovedTestsLocatorTest.cs


示例4: getTestsList

		private string getTestsList(TestRunInfo runInfo)
		{
			var tests = "";
			foreach (var test in runInfo.TestsToRun)
				tests += string.Format("/run:{0} ", test);
			return tests;
		}
开发者ID:roelofb,项目名称:AutoTest.Net,代码行数:7,代码来源:MSTestRunner.cs


示例5: RemoveUnmatchedRunInfoTests

        public List<TestRunResults> RemoveUnmatchedRunInfoTests(TestRunResults[] results, TestRunInfo[] infos)
        {
            var tests = new List<TestItem>();
            tests.AddRange(_cache.Failed);
            tests.AddRange(_cache.Ignored);

            var removed = new List<TestRunResults>();
            infos
                .Where(i => results.Count(x => i.Assembly.Equals(x.Assembly)) == 0).ToList()
                .ForEach(i =>
                    {
                        tests.Where(x => x.Key.Equals(i.Assembly) &&
                                   (!i.OnlyRunSpcifiedTestsFor(x.Value.Runner) || i.GetTestsFor(x.Value.Runner).Count(t => t.Equals(x.Value.Name)) > 0))
                            .GroupBy(x => x.Value.Runner).ToList()
                            .ForEach(x => 
                                {
                                    removed.Add(new TestRunResults(
                                        i.Project.Key,
                                        i.Assembly,
                                        i.OnlyRunSpcifiedTestsFor(TestRunner.Any),
                                        x.Key,
                                        x.Select(t => new TestResult(
                                            t.Value.Runner,
                                            TestRunStatus.Passed,
                                            t.Value.Name,
                                            t.Value.Message,
                                            t.Value.StackTrace,
                                            t.Value.TimeSpent.TotalMilliseconds).SetDisplayName(t.Value.DisplayName)).ToArray()));
                                });
                    });
            return removed;
        }
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:32,代码来源:RemovedTestsLocator.cs


示例6: getResults

 private TestRunResults[] getResults(IEnumerable<AutoTest.TestRunners.Shared.Results.TestResult> tests, TestRunInfo[] runInfos)
 {
     var results = new List<TestRunResults>();
     foreach (var byRunner in tests.GroupBy(x => x.Runner))
     {
         var runner = TestRunnerConverter.FromString(byRunner.Key);
         foreach (var byAssembly in byRunner.GroupBy(x => x.Assembly))
         {
             var info = runInfos.Where(x => x.Assembly.Equals(byAssembly.Key)).FirstOrDefault();
             var project = "";
             var partial = false;
             if (info != null)
             {
                 if (info.Project != null)
                     project = info.Project.Key;
                 partial = info.OnlyRunSpcifiedTestsFor(runner) ||
                           info.GetTestsFor(runner).Count() > 0 ||
                           info.GetMembersFor(runner).Count() > 0 ||
                           info.GetNamespacesFor(runner).Count() > 0;
             }
             DebugLog.Debug.WriteDetail(string.Format("Partial run is {0} for runner {1}", partial, runner));
             
             var result = new TestRunResults(
                                 project,
                                 byAssembly.Key,
                                 partial,
                                 runner,
                                 byAssembly.Select(x => ConvertResult(x)).ToArray());
             result.SetTimeSpent(TimeSpan.FromMilliseconds(byAssembly.Sum(x => x.DurationInMilliseconds)));
             results.Add(result);
         }
     }
     return results.ToArray();
 }
开发者ID:simonlaroche,项目名称:AutoTest.Net,代码行数:34,代码来源:AutoTestTestRunner.cs


示例7: Should_build_the_command_line_for_each_run

        public void Should_build_the_command_line_for_each_run()
        {
            _configuration
                .Stub(x => x.MSpecTestRunner("framework 1"))
                .Return("c:\\runner 1.exe");

            _configuration
                .Stub(x => x.MSpecTestRunner("framework 2"))
                .Return("c:\\runner 2.exe");

            _fileSystem
                .Stub(x => x.FileExists(null))
                .IgnoreArguments()
                .Return(true);

            var document1 = new ProjectDocument(ProjectType.CSharp);
            document1.SetFramework("framework 1");
            var info1 = new TestRunInfo(new Project("key 1", document1), "assembly 1");

            var document2 = new ProjectDocument(ProjectType.CSharp);
            document2.SetFramework("framework 2");
            var info2 = new TestRunInfo(new Project("key 2", document2), "assembly 2");

            var testRunInfos = new[] { info1, info2 };

            _runner.RunTests(testRunInfos, null);

            _commandLineBuilder.AssertWasCalled(x => x.Build(null),
                                                o => o.IgnoreArguments().Repeat.Twice());
        }
开发者ID:jeremywiebe,项目名称:AutoTest.Net,代码行数:30,代码来源:MSpecTestRunnerTest.cs


示例8: Should_not_remove_tests_from_different_runners

        public void Should_not_remove_tests_from_different_runners()
        {
            var cache = new RunResultCache();
            cache.EnabledDeltas();
            var results = new TestRunResults("project", "assembly", false, TestRunner.NUnit, new TestResult[]
                                                    {
                                                        new TestResult(TestRunner.NUnit, TestRunStatus.Failed, "Test1"),
                                                    });
            cache.Merge(results);
            var mah = cache.PopDeltas();
            mah.AddedTests.Length.ShouldEqual(1);

            var infos = new TestRunInfo[] { new TestRunInfo(new Project("project", new ProjectDocument(ProjectType.CSharp)), "assembly") };
            results = new TestRunResults("project", "assembly", false, TestRunner.XUnit, new TestResult[]
                                                    {
                                                        new TestResult(TestRunner.XUnit, TestRunStatus.Failed, "Test1"),
                                                    });

            var locator = new RemovedTestsLocator(cache);
            results = locator.SetRemovedTestsAsPassed(results, infos);
            cache.Merge(results);

            results.Passed.Length.ShouldEqual(0);

            var meh = cache.PopDeltas();
            meh.RemovedTests.Length.ShouldEqual(0);
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:27,代码来源:RemovedTestsLocatorTest.cs


示例9: RunTests

 public TestRunResults[] RunTests(TestRunInfo[] runInfos)
 {
     var options = generateOptions(runInfos);
     if (options == null)
         return new TestRunResults[] { };
     var runner = new TestRunProcess(new AutoTestRunnerFeedback());
     var tests = runner.ProcessTestRuns(options);
     return getResults(tests, runInfos).ToArray();
 }
开发者ID:gtejeda,项目名称:AutoTest.Net,代码行数:9,代码来源:AutoTestTestRunner.cs


示例10: SetUp

        public void SetUp()
        {
            var bus = MockRepository.GenerateMock<IMessageBus>();
            _parser = new NUnitTestResponseParser(bus, TestRunner.NUnit);
			var sources = new TestRunInfo[]
				{ 
					new TestRunInfo(new Project("project1", null), "/SomePath/AutoTest.WinForms.Test/bin/Debug/AutoTest.WinForms.Test.dll")
				};
			_parser.Parse(File.ReadAllText("TestResources/NUnit/singleAssembly.txt"), sources, true);
        }
开发者ID:JamesTryand,项目名称:AutoTest.Net,代码行数:10,代码来源:NUnitTestResponseParserTest.cs


示例11: SetUp

        public void SetUp()
        {
            var bus = MockRepository.GenerateMock<IMessageBus>();
            _parser = new NUnitTestResponseParser(bus);
			var sources = new TestRunInfo[]
				{ 
					new TestRunInfo(new Project("project1", null), string.Format("/home/ack/backup/WorkWin7/src/DotNET/Temp/SomeProjectUsingXUnit/bin/Debug/SomeProjectUsingXUnit.dll", Path.DirectorySeparatorChar))
				};
			_parser.Parse(File.ReadAllText("TestResources/NUnit/XUnitOutput.txt"), sources);
        }
开发者ID:nieve,项目名称:AutoTest.Net,代码行数:10,代码来源:XUnitResponseParserTest.cs


示例12: SetUp

        public void SetUp()
        {
            var bus = MockRepository.GenerateMock<IMessageBus>();
            _parser = new NUnitTestResponseParser(bus, TestRunner.NUnit);
			var sources = new TestRunInfo[]
				{ 
					new TestRunInfo(new Project("project1", null), "/home/ack/src/AutoTest.Net/src/AutoTest.TestCore/bin/Debug/AutoTest.TestCore.dll"),
					new TestRunInfo(new Project("project2", null), "/home/ack/src/AutoTest.Net/src/AutoTest.Test/bin/Debug/AutoTest.Test.dll"),
					new TestRunInfo(new Project("project3", null), "/home/ack/src/AutoTest.Net/src/AutoTest.WinForms.Test/bin/Debug/AutoTest.WinForms.Test.dll")
				};
			_parser.Parse(File.ReadAllText("TestResources/NUnit/NewOutput.txt"), sources, false);
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:12,代码来源:NUnitTestResponseParserNewOutput.cs


示例13: SetRemovedTestsAsPassed

 public TestRunResults SetRemovedTestsAsPassed(TestRunResults results, TestRunInfo[] infos)
 {
     _results = results;
     _infos = infos;
     var tests = new List<TestResult>();
     tests.AddRange(results.All);
     tests.AddRange(getTests(_cache.Failed));
     tests.AddRange(getTests(_cache.Ignored));
     var modified = new TestRunResults(_results.Project, _results.Assembly, _results.IsPartialTestRun, _results.Runner, tests.ToArray());
     modified.SetTimeSpent(_results.TimeSpent);
     return modified;
 }
开发者ID:Buildstarted,项目名称:ContinuousTests,代码行数:12,代码来源:RemovedTestsLocator.cs


示例14: Should_report_the_time_info

        public void Should_report_the_time_info()
        {
            var document = new ProjectDocument(ProjectType.CSharp);
            document.SetFramework("framework 1");
            var info = new TestRunInfo(new Project("key 1", document), "assembly 1");

            var infos = new[] { info };
            var run = new MSpecTestRunner.Run { RunInfos = infos };

            var args = _builder.Build(run);

            Assert.That(args, Is.StringContaining("--timeinfo"));
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:13,代码来源:MSpecCommandLineBuilderTest.cs


示例15: getNUnitExes

		private string[] getNUnitExes(TestRunInfo[] runInfos)
		{
			var testRunnerExes = new List<string>();
			foreach (var runInfo in runInfos)
			{
				var unitTestExe = _configuration.NunitTestRunner(getFramework(runInfo));
	            if (File.Exists(unitTestExe))
				{
					if (!testRunnerExes.Exists(x => x.Equals(unitTestExe)))
	                	testRunnerExes.Add(unitTestExe);
				}
			}
			return testRunnerExes.ToArray();
		}
开发者ID:tonyx,项目名称:AutoTest.Net,代码行数:14,代码来源:NUnitTestRunner.cs


示例16: Should_create_the_assembly_list_from_distinct_assembly_names

        public void Should_create_the_assembly_list_from_distinct_assembly_names()
        {
            var document = new ProjectDocument(ProjectType.CSharp);
            document.SetFramework("framework 1");
            var info1 = new TestRunInfo(new Project("key 1", document), "assembly 1");
            var info2 = new TestRunInfo(new Project("key 2", document), "assembly 1");

            var infos = new[] { info1, info2 };
            var run = new MSpecTestRunner.Run { RunInfos = infos };

            var args = _builder.Build(run);

            var assembly1Count = new Regex("assembly 1").Matches(args).Count;
            Assert.That(assembly1Count, Is.EqualTo(1));
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:15,代码来源:MSpecCommandLineBuilderTest.cs


示例17: Should_create_the_assembly_list

        public void Should_create_the_assembly_list()
        {
            var document = new ProjectDocument(ProjectType.CSharp);
            document.SetFramework("framework 1");
            var info1 = new TestRunInfo(new Project("key 1", document), "assembly 1");
            var info2 = new TestRunInfo(new Project("key 2", document), "assembly 2");

            var infos = new[] { info1, info2 };
            var run = new MSpecTestRunner.Run { RunInfos = infos };

            var args = _builder.Build(run);

            Assert.That(args, Is.StringContaining(" \"assembly 1\""));
            Assert.That(args, Is.StringContaining(" \"assembly 2\""));
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:15,代码来源:MSpecCommandLineBuilderTest.cs


示例18: Should_create_an_xml_report

        public void Should_create_an_xml_report()
        {
            var document = new ProjectDocument(ProjectType.CSharp);
            document.SetFramework("framework 1");
            var info = new TestRunInfo(new Project("key 1", document), "assembly 1");

            var infos = new[] { info };
            var run = new MSpecTestRunner.Run { RunInfos = infos };

            var args = _builder.Build(run);

            Assert.That(args, Is.StringContaining("--xml"));
            Assert.That(run.Cleanups.Count(), Is.EqualTo(1));
            Assert.That(run.Harvesters.Count(), Is.EqualTo(1));
        } 
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:15,代码来源:MSpecCommandLineBuilderTest.cs


示例19: getNUnitExes

		private RunnerExe[] getNUnitExes(TestRunInfo[] runInfos)
		{
			var testRunnerExes = new List<RunnerExe>();
			foreach (var runInfo in runInfos)
			{
				var framework = getFramework(runInfo);
				var unitTestExe = _configuration.NunitTestRunner(framework);
				if (_configuration.GetSpesificNunitTestRunner(framework) == null)
					framework = "";
	            if (File.Exists(unitTestExe))
				{
					if (!testRunnerExes.Exists(x => x.Equals(new RunnerExe(unitTestExe, framework))))
	                	testRunnerExes.Add(new RunnerExe(unitTestExe, framework));
				}
			}
			return testRunnerExes.ToArray();
		}
开发者ID:jeremywiebe,项目名称:AutoTest.Net,代码行数:17,代码来源:NUnitTestRunner.cs


示例20: RunTests

        public TestRunResults[] RunTests(TestRunInfo[] runInfos, Action<AutoTest.TestRunners.Shared.Targeting.Platform, Version, Action<ProcessStartInfo, bool>> processWrapper, Func<bool> abortWhen)
        {
			var results = new List<TestRunResults>();
			foreach (var runInfo in runInfos)
			{			
	            var timer = Stopwatch.StartNew();
	            var unitTestExe = _configuration.MSTestRunner(getFramework(runInfo));
	            if (!File.Exists(unitTestExe))
				{
					var project = "";
					if (runInfo.Project != null)
						project = runInfo.Project.Key;
	                results.Add(new TestRunResults(project, runInfo.Assembly, false, TestRunner.MSTest, new TestResult[] { }));
					continue;
				}
				
                if (runInfo.OnlyRunSpcifiedTestsFor(TestRunner.MSTest) && runInfo.GetTestsFor(TestRunner.MSTest).Length.Equals(0))
                    continue;
				var calc = new MaxCmdLengthCalculator();
				var tests = getTestsList(runInfo);
                var testRunConfig = getTestrunConfigArguments();
				var arguments = "/testcontainer:\"" + runInfo.Assembly + "\" " + tests + " /detail:errorstacktrace /detail:errormessage" + testRunConfig;
                var runAllTests = (arguments.Length + unitTestExe.Length) > calc.GetLength();
				if (runAllTests)
                    arguments = "/testcontainer:\"" + runInfo.Assembly + "\"" + " /detail:errorstacktrace /detail:errormessage" + testRunConfig;
				DebugLog.Debug.WriteInfo("Running tests: {0} {1}", unitTestExe, arguments); 
	            var proc = new Process();
	            proc.StartInfo = new ProcessStartInfo(unitTestExe, arguments);
	            proc.StartInfo.RedirectStandardOutput = true;
	            proc.StartInfo.WorkingDirectory = Path.GetDirectoryName(runInfo.Assembly);
	            proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
	            proc.StartInfo.UseShellExecute = false;
	            proc.StartInfo.CreateNoWindow = true;
	
	            proc.Start();
	            string line;
	            var parser = new MSTestResponseParser(runInfo.Project.Key, runInfo.Assembly, !runAllTests);
	            while ((line = proc.StandardOutput.ReadLine()) != null)
	                parser.ParseLine(line);
	            proc.WaitForExit();
	            timer.Stop();
	            parser.Result.SetTimeSpent(timer.Elapsed);
	            results.Add(parser.Result);
			}
			return results.ToArray();
        }
开发者ID:Vernathic,项目名称:ic-AutoTest.NET4CTDD,代码行数:46,代码来源:MSTestRunner.cs



注:本文中的AutoTest.Core.Messaging.MessageConsumers.TestRunInfo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Options.RunSettings类代码示例发布时间:2022-05-24
下一篇:
C# Projects.ProjectDocument类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap