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); }
/// <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); }