@@ -26,25 +26,25 @@ namespace SharpRepository.Tests.Integration.Data
2626{
2727 public class RepositoryTestCaseDataFactory
2828 {
29- public static IEnumerable < TestCaseData > Build ( RepositoryType [ ] includeType )
29+ public static IEnumerable < TestCaseData > Build ( RepositoryType [ ] includeType , string testName = "Test" )
3030 {
3131 if ( includeType . Contains ( RepositoryType . InMemory ) )
3232 {
33- yield return new TestCaseData ( new InMemoryRepository < Contact , string > ( ) ) . SetName ( "InMemoryRepository Test" ) ;
33+ yield return new TestCaseData ( new InMemoryRepository < Contact , string > ( ) ) . SetName ( "InMemoryRepository " + testName ) ;
3434 }
3535
3636 if ( includeType . Contains ( RepositoryType . Xml ) )
3737 {
3838 var xmlDataDirectoryPath = XmlDataDirectoryFactory . Build ( "Contact" ) ;
3939 yield return
40- new TestCaseData ( new XmlRepository < Contact , string > ( xmlDataDirectoryPath ) ) . SetName ( "XmlRepository Test" ) ;
40+ new TestCaseData ( new XmlRepository < Contact , string > ( xmlDataDirectoryPath ) ) . SetName ( "XmlRepository" + testName ) ;
4141 }
4242
4343 if ( includeType . Contains ( RepositoryType . Ef ) )
4444 {
4545 var dbPath = EfDataDirectoryFactory . Build ( ) ;
4646 yield return
47- new TestCaseData ( new EfRepository < Contact , string > ( new TestObjectContext ( "Data Source=" + dbPath ) ) ) . SetName ( "EfRepository Test" ) ;
47+ new TestCaseData ( new EfRepository < Contact , string > ( new TestObjectContext ( "Data Source=" + dbPath ) ) ) . SetName ( "EfRepository" + testName ) ;
4848 }
4949
5050 if ( includeType . Contains ( RepositoryType . EfCore ) )
@@ -59,13 +59,13 @@ public static IEnumerable<TestCaseData> Build(RepositoryType[] includeType)
5959 // Create the schema in the database
6060 var context = new TestObjectContextCore ( options ) ;
6161 context . Database . EnsureCreated ( ) ;
62- yield return new TestCaseData ( new EfCoreRepository < Contact , string > ( context ) ) . SetName ( "EfCoreRepository Test" ) ;
62+ yield return new TestCaseData ( new EfCoreRepository < Contact , string > ( context ) ) . SetName ( "EfCoreRepository " + testName ) ;
6363 }
6464
6565 if ( includeType . Contains ( RepositoryType . Dbo4 ) )
6666 {
6767 var dbPath = Db4oDataDirectoryFactory . Build ( "Contact" ) ;
68- yield return new TestCaseData ( new Db4oRepository < Contact , string > ( dbPath ) ) . SetName ( "Db4oRepository Test" ) ;
68+ yield return new TestCaseData ( new Db4oRepository < Contact , string > ( dbPath ) ) . SetName ( "Db4oRepository " + testName ) ;
6969 }
7070
7171 if ( includeType . Contains ( RepositoryType . MongoDb ) )
@@ -75,7 +75,7 @@ public static IEnumerable<TestCaseData> Build(RepositoryType[] includeType)
7575 if ( MongoDbRepositoryManager . ServerIsRunning ( connectionString ) )
7676 {
7777 MongoDbRepositoryManager . DropDatabase ( connectionString ) ; // Pre-test cleanup
78- yield return new TestCaseData ( new MongoDbRepository < Contact , string > ( connectionString ) ) . SetName ( "MongoDb Test" ) ;
78+ yield return new TestCaseData ( new MongoDbRepository < Contact , string > ( connectionString ) ) . SetName ( "MongoDb " + testName ) ;
7979 }
8080 }
8181
@@ -92,13 +92,13 @@ public static IEnumerable<TestCaseData> Build(RepositoryType[] includeType)
9292 }
9393
9494 IDocumentStore x = new EmbeddableDocumentStore ( ) ;
95- yield return new TestCaseData ( new RavenDbRepository < Contact , string > ( documentStore : documentStore ) ) . SetName ( "RavenDbRepository Test" ) ;
95+ yield return new TestCaseData ( new RavenDbRepository < Contact , string > ( documentStore : documentStore ) ) . SetName ( "RavenDbRepository " + testName ) ;
9696 }
9797
9898 if ( includeType . Contains ( RepositoryType . Cache ) )
9999 {
100100 var cachingProvider = new InMemoryCachingProvider ( new MemoryCache ( new MemoryCacheOptions ( ) ) ) ;
101- yield return new TestCaseData ( new CacheRepository < Contact , string > ( CachePrefixFactory . Build ( ) , cachingProvider ) ) . SetName ( "CacheRepository Test" ) ;
101+ yield return new TestCaseData ( new CacheRepository < Contact , string > ( CachePrefixFactory . Build ( ) , cachingProvider ) ) . SetName ( "CacheRepository " + testName ) ;
102102 }
103103
104104 if ( includeType . Contains ( RepositoryType . CouchDb ) )
@@ -109,7 +109,7 @@ public static IEnumerable<TestCaseData> Build(RepositoryType[] includeType)
109109 CouchDbRepositoryManager . DropDatabase ( CouchDbUrl . Host , CouchDbUrl . Port , databaseName ) ;
110110 CouchDbRepositoryManager . CreateDatabase ( CouchDbUrl . Host , CouchDbUrl . Port , databaseName ) ;
111111
112- yield return new TestCaseData ( new CouchDbRepository < Contact , string > ( CouchDbUrl . Host , CouchDbUrl . Port , databaseName ) ) . SetName ( "CouchDbRepository Test" ) ;
112+ yield return new TestCaseData ( new CouchDbRepository < Contact , string > ( CouchDbUrl . Host , CouchDbUrl . Port , databaseName ) ) . SetName ( "CouchDbRepository " + testName ) ;
113113 }
114114
115115 }
0 commit comments