コード例 #1
0
        internal static IEnumerable <IXunitTestCase> CreateSkippedDataRowTestCases(ITestMethod testMethod, TestMethodDisplay testMethodDisplay, IMessageSink diagnosticMessageSink, object[] dataRow, string skipReason)
        {
            Xunit.VsTestFramework.ThrowIfNotInUse();
            var testSettings = VsTestSettingsUtil.FromTestMethod(testMethod);

            foreach (var instance in GetInstances(Installations.Value, testMethod, testSettings, Instances))
            {
                yield return(new VsSkippedDataRowTestCase(instance.Id, diagnosticMessageSink, testMethodDisplay, testMethod, skipReason, dataRow));
            }
        }
コード例 #2
0
        public static IEnumerable <IXunitTestCase> CreateTestCases(ITestMethod testMethod, object[] testMethodArguments, TestMethodDisplay testMethodDisplay, IMessageSink diagnosticMessageSink)
        {
            Xunit.VsTestFramework.ThrowIfNotInUse();
            var testSettings = VsTestSettingsUtil.FromTestMethod(testMethod);

            foreach (var instance in GetInstances(Installations.Value, testMethod, testSettings, Instances))
            {
                var testCase = new VsTestCase(instance.Id, instance.Path, testSettings, diagnosticMessageSink, testMethodDisplay, instance.CreateTestMethod(testMethod), testMethodArguments);
                yield return(testCase);

                if (string.IsNullOrEmpty(testCase.SkipReason) && instance.DidReportInstanceTestCase == false)
                {
                    yield return(new VsInstanceTestCase(instance.Id, diagnosticMessageSink, testMethodDisplay, instance.CreateVisualStudioTestMethod()));
                }
            }
        }
コード例 #3
0
 public override void Deserialize(IXunitSerializationInfo info)
 {
     base.Deserialize(info);
     InstancePath = info.GetValue <string>(nameof(InstancePath));
     Settings     = VsTestSettingsUtil.FromTestMethod(TestMethod);
 }