public static void StartTestCase(ITestCaseStarting testCaseStarting) { if (testCaseStarting.TestCase is not ITestResultAccessor testResults) { return; } StartTestContainer(testCaseStarting.TestClass, testResults); var testCase = testCaseStarting.TestCase; var uuid = NewUuid(testCase.DisplayName); testResults.TestResult = new() { uuid = uuid, name = testCase.DisplayName, historyId = testCase.DisplayName, fullName = testCase.DisplayName, labels = new() { Label.Thread(), Label.Host(), Label.TestClass(testCase.TestMethod.TestClass.Class.Name), Label.TestMethod(testCase.DisplayName), Label.Package(testCase.TestMethod.TestClass.Class.Name) } }; UpdateTestDataFromAttributes(testResults.TestResult, testCase); AllureLifecycle.Instance.StartTestCase(testResults.TestResultContainer.uuid, testResults.TestResult); }
protected override bool Visit(ITestCaseStarting value) { _dictionary.TryAdd(value.TestCase, new TestData { DisplayName = value.TestCase.DisplayName }); return(base.Visit(value)); }
// There can be one or more test cases per method // Pre-enumerated theories are individual test cases // A test case will map to either a method element, or a theory element protected override bool Visit(ITestCaseStarting testCaseStarting) { var taskInfo = context.GetRemoteTask(testCaseStarting); taskInfo.Starting(); return(context.ShouldContinue); }
protected override bool Visit(ITestCaseStarting testCaseStarting) { var vsTestCase = FindTestCase(testCaseStarting.TestCase); if (vsTestCase != null) { TryAndReport("RecordStart", testCaseStarting.TestCase, () => recorder.RecordStart(vsTestCase)); } else { logger.LogWarning(testCaseStarting.TestCase, "(Starting) Could not find VS test case for {0} (ID = {1})", testCaseStarting.TestCase.DisplayName, testCaseStarting.TestCase.UniqueID); } return(!cancelledThunk()); }
_TestCaseStarting AdaptTestCaseStarting(ITestCaseStarting message) { var testCollectionUniqueID = UniqueIDForTestCollection(assemblyUniqueID, message.TestCollection); var testClassUniqueID = UniqueIDForTestClass(testCollectionUniqueID, message.TestClass); var testMethodUniqueID = UniqueIDForTestMethod(testClassUniqueID, message.TestMethod); return(new _TestCaseStarting { AssemblyUniqueID = assemblyUniqueID, SkipReason = message.TestCase.SkipReason, SourceFilePath = message.TestCase.SourceInformation?.FileName, SourceLineNumber = message.TestCase.SourceInformation?.LineNumber, TestCaseDisplayName = message.TestCase.DisplayName, TestCaseUniqueID = message.TestCase.UniqueID, TestClassUniqueID = testClassUniqueID, TestCollectionUniqueID = testCollectionUniqueID, TestMethodUniqueID = testMethodUniqueID, Traits = message.TestCase.Traits }); }
/// <summary> /// Called when an instance of <see cref="ITestCaseStarting"/> is sent to the message sink. /// </summary> /// <param name="testCaseStarting">The message.</param> /// <returns>Return <c>true</c> to continue executing tests; <c>false</c> otherwise.</returns> protected virtual bool Visit(ITestCaseStarting testCaseStarting) { return(true); }
protected override bool Visit(ITestCaseStarting testCaseStarting) { Calls.Add("ITestCaseStarting"); return base.Visit(testCaseStarting); }
protected override bool Visit(ITestCaseStarting testCaseStarting) { Calls.Add("ITestCaseStarting"); return(base.Visit(testCaseStarting)); }
protected override bool Visit(ITestCaseStarting testCaseStarting) { executionListener.OnTestCaseStarting(testCaseStarting.TestCase.UniqueID); return(true); }
protected override bool Visit(ITestCaseStarting testCaseStarting) { executionListener.OnTestCaseStarting(testCaseStarting.TestCase.UniqueID); return(!executionListener.IsCancelRequested); }