File tree 4 files changed +33
-3
lines changed
4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 10
10
namespace CommunityToolkit . Datasync . Server . EntityFrameworkCore . Test ;
11
11
12
12
[ ExcludeFromCodeCoverage ]
13
+ [ Collection ( "LiveTestsCollection" ) ]
13
14
public class AzureSqlEntityTableRepository_Tests : RepositoryTests < AzureSqlEntityMovie >
14
15
{
15
16
#region Setup
17
+ private readonly DatabaseFixture _fixture ;
16
18
private readonly Random random = new ( ) ;
17
19
private readonly string connectionString ;
18
20
private readonly List < AzureSqlEntityMovie > movies ;
19
21
private readonly Lazy < AzureSqlDbContext > _context ;
20
22
21
- public AzureSqlEntityTableRepository_Tests ( ITestOutputHelper output ) : base ( )
23
+ public AzureSqlEntityTableRepository_Tests ( DatabaseFixture fixture , ITestOutputHelper output ) : base ( )
22
24
{
25
+ this . _fixture = fixture ;
23
26
this . connectionString = Environment . GetEnvironmentVariable ( "DATASYNC_AZSQL_CONNECTIONSTRING" ) ;
24
27
if ( ! string . IsNullOrEmpty ( this . connectionString ) )
25
28
{
Original file line number Diff line number Diff line change 10
10
namespace CommunityToolkit . Datasync . Server . EntityFrameworkCore . Test ;
11
11
12
12
[ ExcludeFromCodeCoverage ]
13
+ [ Collection ( "LiveTestsCollection" ) ]
13
14
public class CosmosEntityTableRepository_Tests : RepositoryTests < CosmosEntityMovie >
14
15
{
15
16
#region Setup
17
+ private readonly DatabaseFixture _fixture ;
16
18
private readonly Random random = new ( ) ;
17
19
private readonly string connectionString ;
18
20
private readonly List < CosmosEntityMovie > movies ;
19
21
private readonly Lazy < CosmosDbContext > _context ;
20
22
21
- public CosmosEntityTableRepository_Tests ( ITestOutputHelper output ) : base ( )
23
+ public CosmosEntityTableRepository_Tests ( DatabaseFixture fixture , ITestOutputHelper output ) : base ( )
22
24
{
25
+ this . _fixture = fixture ;
23
26
this . connectionString = Environment . GetEnvironmentVariable ( "DATASYNC_COSMOS_CONNECTIONSTRING" ) ;
24
27
if ( ! string . IsNullOrEmpty ( this . connectionString ) )
25
28
{
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 10
10
namespace CommunityToolkit . Datasync . Server . EntityFrameworkCore . Test ;
11
11
12
12
[ ExcludeFromCodeCoverage ]
13
+ [ Collection ( "LiveTestsCollection" ) ]
13
14
public class PgEntityTableRepository_Tests : RepositoryTests < PgEntityMovie >
14
15
{
15
16
#region Setup
17
+ private readonly DatabaseFixture _fixture ;
16
18
private readonly Random random = new ( ) ;
17
19
private readonly string connectionString ;
18
20
private readonly List < PgEntityMovie > movies ;
19
21
private readonly Lazy < PgDbContext > _context ;
20
22
21
- public PgEntityTableRepository_Tests ( ITestOutputHelper output ) : base ( )
23
+ public PgEntityTableRepository_Tests ( DatabaseFixture fixture , ITestOutputHelper output ) : base ( )
22
24
{
25
+ this . _fixture = fixture ;
23
26
this . connectionString = Environment . GetEnvironmentVariable ( "DATASYNC_PGSQL_CONNECTIONSTRING" ) ;
24
27
if ( ! string . IsNullOrEmpty ( this . connectionString ) )
25
28
{
You can’t perform that action at this time.
0 commit comments