private IEnumerable <IXunitTestCase> DiscoverRazorTests(Type testComponent, ITestMethod testMethod) { DiagnosticMessageSink.OnMessage(new DiagnosticMessage($"{nameof(DiscoverRazorTests)}: Discovering in {testComponent.FullName}.")); using var razorRenderer = new TestComponentRenderer(); var tests = razorRenderer.GetRazorTestsFromComponent(testComponent); var result = tests.Count == 0 ? Array.Empty <IXunitTestCase>() : new IXunitTestCase[tests.Count]; for (int index = 0; index < tests.Count; index++) { var test = tests[index]; var testNumber = index + 1; var sourceInfo = _sourceInfoDiscoverer.GetSourceInformation(testComponent, test, testNumber); result[index] = new RazorTestCase(GetDisplayName(test, testNumber), test.Timeout, test.Skip, testNumber, testMethod, sourceInfo); } return(result); }
public RazorTest(RazorTestCase testCase, string displayName) : base(testCase, displayName) { TestNumber = testCase.TestNumber; }
public RazorTestCaseRunner(RazorTestCase testCase, string displayName, string?skipReason, object[] constructorArguments, object[] testMethodArguments, IMessageBus messageBus, ExceptionAggregator aggregator, CancellationTokenSource cancellationTokenSource) : base(testCase, displayName, skipReason, constructorArguments, testMethodArguments, messageBus, aggregator, cancellationTokenSource) { _razorTestCase = testCase; }