コード例 #1
0
    public IEnumerable <IXunitTestCase> Discover(ITestFrameworkDiscoveryOptions discoveryOptions,
                                                 ITestMethod testMethod, IAttributeInfo factAttribute)
    {
        var result = new List <IXunitTestCase>();
        var types  = factAttribute.GetNamedArgument <Type[]>("Types");

        foreach (var type in types)
        {
            var typeInfo          = new ReflectionTypeInfo(type);
            var genericMethodInfo = testMethod.Method.MakeGenericMethod(typeInfo);
            var genericTestMethod = new GenericTestMethod(testMethod.TestClass, genericMethodInfo, typeInfo);
            result.Add(
                new XunitTestCase(DiagnosticMessageSink, discoveryOptions.MethodDisplayOrDefault(),
                                  genericTestMethod));
        }
        return(result);
    }
コード例 #2
0
ファイル: GenericTestCaseTests.cs プロジェクト: ggeurts/nhive
        public void SetUp()
        {
            MethodInfo testMethod = typeof(FakeTestFixture <>).GetMethod("FakeTestMethod");

            _testCase = new GenericTestMethod(testMethod);
        }