Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test;

[ExcludeFromCodeCoverage]
[Collection("LiveTestsCollection")]
public class AzureSqlEntityTableRepository_Tests : RepositoryTests<AzureSqlEntityMovie>
{
#region Setup
private readonly DatabaseFixture _fixture;
private readonly Random random = new();
private readonly string connectionString;
private readonly List<AzureSqlEntityMovie> movies;
private readonly Lazy<AzureSqlDbContext> _context;

public AzureSqlEntityTableRepository_Tests(ITestOutputHelper output) : base()
public AzureSqlEntityTableRepository_Tests(DatabaseFixture fixture, ITestOutputHelper output) : base()
{
this._fixture = fixture;
this.connectionString = Environment.GetEnvironmentVariable("DATASYNC_AZSQL_CONNECTIONSTRING");
if (!string.IsNullOrEmpty(this.connectionString))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test;

[ExcludeFromCodeCoverage]
[Collection("LiveTestsCollection")]
public class CosmosEntityTableRepository_Tests : RepositoryTests<CosmosEntityMovie>
{
#region Setup
private readonly DatabaseFixture _fixture;
private readonly Random random = new();
private readonly string connectionString;
private readonly List<CosmosEntityMovie> movies;
private readonly Lazy<CosmosDbContext> _context;

public CosmosEntityTableRepository_Tests(ITestOutputHelper output) : base()
public CosmosEntityTableRepository_Tests(DatabaseFixture fixture, ITestOutputHelper output) : base()
{
this._fixture = fixture;
this.connectionString = Environment.GetEnvironmentVariable("DATASYNC_COSMOS_CONNECTIONSTRING");
if (!string.IsNullOrEmpty(this.connectionString))
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test;

/// <summary>
/// This can be used to share state between the various live tests. It isn't used right now.
/// </summary>
public class DatabaseFixture
{

}

[CollectionDefinition("LiveTestsCollection", DisableParallelization = true)]
public class LiveTestsCollection : ICollectionFixture<DatabaseFixture>
{
// This class has no code, and is never created. Its purpose is simply
// to be the place to apply [CollectionDefinition] and all the
// ICollectionFixture<> interfaces.
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,19 @@
namespace CommunityToolkit.Datasync.Server.EntityFrameworkCore.Test;

[ExcludeFromCodeCoverage]
[Collection("LiveTestsCollection")]
public class PgEntityTableRepository_Tests : RepositoryTests<PgEntityMovie>
{
#region Setup
private readonly DatabaseFixture _fixture;
private readonly Random random = new();
private readonly string connectionString;
private readonly List<PgEntityMovie> movies;
private readonly Lazy<PgDbContext> _context;

public PgEntityTableRepository_Tests(ITestOutputHelper output) : base()
public PgEntityTableRepository_Tests(DatabaseFixture fixture, ITestOutputHelper output) : base()
{
this._fixture = fixture;
this.connectionString = Environment.GetEnvironmentVariable("DATASYNC_PGSQL_CONNECTIONSTRING");
if (!string.IsNullOrEmpty(this.connectionString))
{
Expand Down
Loading