예제 #1
0
파일: App.xaml.cs 프로젝트: tencek/tickspec
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            var harness  = new UnitTestHarness();
            var settings = new UnitTestSettings();

            settings.TestHarness = harness;
            harness.Settings     = settings;
            harness.Initialize();

            harness.TestRunStarting += (senderx, ex) =>
            {
                var provider = new TestProvider();
                var filter   = new TagTestRunFilter(settings, harness, settings.TagExpression);

                var features = FeatureFactory.GetFeatures(typeof(App).Assembly);
                foreach (var feature in features)
                {
                    provider.RegisterFeature(feature);
                    var ass = provider.GetUnitTestAssembly(harness, feature.Assembly);
                    harness.EnqueueTestAssembly(ass, filter);
                }
            };

            this.RootVisual = UnitTestSystem.CreateTestPage(settings);
        }
예제 #2
0
            /// <summary>
            /// Adds the retry action link.
            /// </summary>
            /// <param name="actions">The action container.</param>
            private void AddRetryAction(HtmlControl actions)
            {
                HtmlAnchor rerun = new HtmlAnchor(
                    "Retry this test",
                    delegate(object sender, HtmlEventArgs args)
                {
                    RetryTestRunFilter retryFilter = new RetryTestRunFilter(Inspector.Result.TestClass, Inspector.Result.TestMethod);
                    UnitTestHarness ut             = UnitTestHarness;
                    if (ut != null)
                    {
                        ut.RestartRunDispatcher();
                        ut.EnqueueTestAssembly(Inspector.Result.TestClass.Assembly, retryFilter);
                    }
                });

                StyleActionLink(rerun);
                actions.Controls.Add(rerun);
            }