예제 #1
0
        private void SendExistingTestCases()
        {
            if (testCaseBatch.Count == 0)
            {
                return;
            }

            var descriptors = descriptorProvider.GetTestCaseDescriptors(testCaseBatch, includeSerialization: testPlatformContext.RequireXunitTestProperty);

            foreach (var descriptor in descriptors)
            {
                var vsTestCase = CreateVsTestCase(source, descriptor, logger, testPlatformContext);
                if (vsTestCase != null)
                {
                    if (discoveryOptions.GetInternalDiagnosticMessagesOrDefault())
                    {
                        logger.LogWithSource(source, "Discovered test case '{0}' (ID = '{1}', VS FQN = '{2}')", descriptor.DisplayName, descriptor.UniqueID, vsTestCase.FullyQualifiedName);
                    }

                    discoverySink.SendTestCase(vsTestCase);
                }
            }

            testCaseBatch.Clear();
        }
예제 #2
0
        private void SendExistingTestCases()
        {
            var forceUniqueNames = lastTestMethodTestCases.Count > 1;

            foreach (var testCase in lastTestMethodTestCases)
            {
                var vsTestCase = CreateVsTestCase(source, discoverer, testCase, forceUniqueNames, logger, designMode);
                if (vsTestCase != null)
                {
                    if (discoveryOptions.GetInternalDiagnosticMessagesOrDefault())
                    {
                        logger.Log(testCase, "Discovered test case '{0}' (ID = '{1}', VS FQN = '{2}')", testCase.DisplayName, testCase.UniqueID, vsTestCase.FullyQualifiedName);
                    }

                    discoverySink.SendTestCase(vsTestCase);
                }
                else
                {
                    logger.LogWarning(testCase, "Could not create VS test case for '{0}' (ID = '{1}', VS FQN = '{2}')", testCase.DisplayName, testCase.UniqueID, vsTestCase.FullyQualifiedName);
                }
            }

            lastTestMethodTestCases.Clear();
        }