Exemplo n.º 1
0
        public override IEnumerable <string> InterceptTestDataSources(DataSourcesBaseAttribute dataSourcesAttribute, IMethodInfo testMethod, IEnumerable <string> contexts)
        {
            var test = ExtractMethod(testMethod);

            //Filter out specific tests
            switch (ExtractMethod(testMethod))
            {
            //Test targets DB2 provider
            case ("SchemaProviderTests", "DB2Test"):
            //Tests have internal logic based on BulkCopyType - Copied to custom tests
            case ("BulkCopyTests", "KeepIdentity_SkipOnInsertTrue"):
            case ("BulkCopyTests", "KeepIdentity_SkipOnInsertFalse"):
            //Tests have property have space - Copied to custom tests
            case ("DynamicColumnsTests", "SqlPropertyNoStoreNonIdentifier"):
            case ("DynamicColumnsTests", "SqlPropertyNoStoreNonIdentifierGrouping"):
            //Test copied to custom to reduce default source row number
            case ("MergeTests", "BigSource"):
            //Tests passing provider specific parameter types - Generic linq2db test - Not applicable
            case ("MergeTests", "TestParametersInListSourceProperty"):
            //Tests active issue with DB2 family ordering NULL last by default - Not applicable
            case ("MergeTests", "SortedMergeResultsIssue"):
            //Too many cases in code - Copied to custom tests
            case ("CharTypesTests", _):
            //Too many changes and cases - Copied to custom tests
            case ("MergeTests", "TestTypesInsertByMerge"):
            case ("MergeTests", "TestMergeTypes"):
            case ("MergeTests", "TestDB2NullsInSource"):
            //Case valid for DB2 but not for DB2i
            case ("Issue792Tests", "TestWithTransactionThrowsFromProvider"):
            //Data not valid for DB2i
            case ("Issue1287Tests", _):
            //Query contains invalid keyword permission
            case ("Issue825Tests", "Test"):
                return(Enumerable.Empty <string>());

            //Access client throws a different exception so it is excluded
            case ("DataContextTests", "ProviderConnectionStringConstructorTest2"):
                return(contexts.Except(TestProvNameDb2i.GetProviders(TestProvNameDb2i.All_AccessClient)));
            }

            return(contexts);
        }
 /// <summary>
 /// Intercept and mutate the set of datasources/contexts passed to a specific test.
 /// Use this method to mutate providers or switch off specific tess.
 /// </summary>
 /// <param name="dataSourcesAttribute">The DataSourcesAttribute instance associated with the test.</param>
 /// <param name="testMethod">The reflected test method.</param>
 /// <param name="contexts">The default datasources/contexts for given tests</param>
 /// <returns>The actual datasources that test should run with.</returns>
 public virtual IEnumerable <string> InterceptTestDataSources(DataSourcesBaseAttribute dataSourcesAttribute, IMethodInfo testMethod, IEnumerable <string> contexts)
 => contexts;
 /// <summary>
 /// Intercept and mutate the set of supported datasources/contexts when scanning for tests.
 /// Use this method to replace aliases with actual providers.
 /// </summary>
 /// <param name="dataSourcesAttribute">The DataSourcesAttribute instance associated with the test.</param>
 /// <param name="contexts">The default datasources passed to a test by DataSourcesAttribute.</param>
 /// <returns>The actual datasources that test should run with.</returns>
 public virtual IEnumerable <string> InterceptDataSources(DataSourcesBaseAttribute dataSourcesAttribute, IEnumerable <string> contexts)
 => contexts;
Exemplo n.º 4
0
 public override IEnumerable <string> InterceptDataSources(DataSourcesBaseAttribute dataSourcesAttribute, IEnumerable <string> contexts)
 {
     return(contexts.Concat(TestProvNameDb2i.GetProviders(contexts)));
 }