File tree Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Expand file tree Collapse file tree 4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1010namespace CommunityToolkit . Datasync . Server . EntityFrameworkCore . Test ;
1111
1212[ ExcludeFromCodeCoverage ]
13+ [ Collection ( "LiveTestsCollection" ) ]
1314public class AzureSqlEntityTableRepository_Tests : RepositoryTests < AzureSqlEntityMovie >
1415{
1516 #region Setup
17+ private readonly DatabaseFixture _fixture ;
1618 private readonly Random random = new ( ) ;
1719 private readonly string connectionString ;
1820 private readonly List < AzureSqlEntityMovie > movies ;
1921 private readonly Lazy < AzureSqlDbContext > _context ;
2022
21- public AzureSqlEntityTableRepository_Tests ( ITestOutputHelper output ) : base ( )
23+ public AzureSqlEntityTableRepository_Tests ( DatabaseFixture fixture , ITestOutputHelper output ) : base ( )
2224 {
25+ this . _fixture = fixture ;
2326 this . connectionString = Environment . GetEnvironmentVariable ( "DATASYNC_AZSQL_CONNECTIONSTRING" ) ;
2427 if ( ! string . IsNullOrEmpty ( this . connectionString ) )
2528 {
Original file line number Diff line number Diff line change 1010namespace CommunityToolkit . Datasync . Server . EntityFrameworkCore . Test ;
1111
1212[ ExcludeFromCodeCoverage ]
13+ [ Collection ( "LiveTestsCollection" ) ]
1314public class CosmosEntityTableRepository_Tests : RepositoryTests < CosmosEntityMovie >
1415{
1516 #region Setup
17+ private readonly DatabaseFixture _fixture ;
1618 private readonly Random random = new ( ) ;
1719 private readonly string connectionString ;
1820 private readonly List < CosmosEntityMovie > movies ;
1921 private readonly Lazy < CosmosDbContext > _context ;
2022
21- public CosmosEntityTableRepository_Tests ( ITestOutputHelper output ) : base ( )
23+ public CosmosEntityTableRepository_Tests ( DatabaseFixture fixture , ITestOutputHelper output ) : base ( )
2224 {
25+ this . _fixture = fixture ;
2326 this . connectionString = Environment . GetEnvironmentVariable ( "DATASYNC_COSMOS_CONNECTIONSTRING" ) ;
2427 if ( ! string . IsNullOrEmpty ( this . connectionString ) )
2528 {
Original file line number Diff line number Diff line change 1+ // Licensed to the .NET Foundation under one or more agreements.
2+ // The .NET Foundation licenses this file to you under the MIT license.
3+ // See the LICENSE file in the project root for more information.
4+
5+ namespace CommunityToolkit . Datasync . Server . EntityFrameworkCore . Test ;
6+
7+ /// <summary>
8+ /// This can be used to share state between the various live tests. It isn't used right now.
9+ /// </summary>
10+ public class DatabaseFixture
11+ {
12+
13+ }
14+
15+ [ CollectionDefinition ( "LiveTestsCollection" , DisableParallelization = true ) ]
16+ public class LiveTestsCollection : ICollectionFixture < DatabaseFixture >
17+ {
18+ // This class has no code, and is never created. Its purpose is simply
19+ // to be the place to apply [CollectionDefinition] and all the
20+ // ICollectionFixture<> interfaces.
21+ }
Original file line number Diff line number Diff line change 1010namespace CommunityToolkit . Datasync . Server . EntityFrameworkCore . Test ;
1111
1212[ ExcludeFromCodeCoverage ]
13+ [ Collection ( "LiveTestsCollection" ) ]
1314public class PgEntityTableRepository_Tests : RepositoryTests < PgEntityMovie >
1415{
1516 #region Setup
17+ private readonly DatabaseFixture _fixture ;
1618 private readonly Random random = new ( ) ;
1719 private readonly string connectionString ;
1820 private readonly List < PgEntityMovie > movies ;
1921 private readonly Lazy < PgDbContext > _context ;
2022
21- public PgEntityTableRepository_Tests ( ITestOutputHelper output ) : base ( )
23+ public PgEntityTableRepository_Tests ( DatabaseFixture fixture , ITestOutputHelper output ) : base ( )
2224 {
25+ this . _fixture = fixture ;
2326 this . connectionString = Environment . GetEnvironmentVariable ( "DATASYNC_PGSQL_CONNECTIONSTRING" ) ;
2427 if ( ! string . IsNullOrEmpty ( this . connectionString ) )
2528 {
You can’t perform that action at this time.
0 commit comments