Use block-scoped namespaces in the test suite

Converts all 73 test source files from file-scoped (namespace X;) to
block-scoped (namespace X { ... }) declarations, re-indenting their
contents accordingly. Matches the existing convention already used in
several production files (e.g. Musify.Infrastructure.Configuration,
Musify.Application.Contracts).

Mechanical change only, done with a script, verified with a full
rebuild (0 warnings, 0 errors) and test run (257/257 passing).
This commit is contained in:
2026-09-09 23:09:43 +02:00
parent 56e06ccd5f
commit b5700614c1
73 changed files with 3718 additions and 3645 deletions
@@ -5,46 +5,47 @@ using Musify.Application.Tests.TestSupport;
using NSubstitute;
using Xunit;
namespace Musify.Application.Tests.Services;
public sealed class TrackStreamIssuerTests : HandlerTestBase
namespace Musify.Application.Tests.Services
{
private readonly IStreamTicketService ticketService = Substitute.For<IStreamTicketService>();
private TrackStreamIssuer CreateIssuer() => new(
Database, ticketService, TestConfigurations.Track(), TestConfigurations.StreamGateway("https://stream.musify.test/"));
[Fact]
public async Task IssueAsync_BuildsManifestUrlAndRecordsListeningHistory()
public sealed class TrackStreamIssuerTests : HandlerTestBase
{
ticketService.IssueTicket(7, Arg.Any<string>()).Returns(new StreamTicket("signed-token", 120));
var owner = TestEntities.User(7);
var track = TestEntities.LocalTrack(owner);
await SeedAsync(owner, track);
private readonly IStreamTicketService ticketService = Substitute.For<IStreamTicketService>();
var response = await CreateIssuer().IssueAsync(track.Id, "folder-42", userId: 7, TestContext.Current.CancellationToken);
private TrackStreamIssuer CreateIssuer() => new(
Database, ticketService, TestConfigurations.Track(), TestConfigurations.StreamGateway("https://stream.musify.test/"));
Assert.Equal("signed-token", response.Ticket);
Assert.Equal(120, response.ExpiresInSeconds);
Assert.Equal(
"https://stream.musify.test/media/Tracks/ProcessedAudios/folder-42/audio.m4a",
response.ManifestUrl);
[Fact]
public async Task IssueAsync_BuildsManifestUrlAndRecordsListeningHistory()
{
ticketService.IssueTicket(7, Arg.Any<string>()).Returns(new StreamTicket("signed-token", 120));
var owner = TestEntities.User(7);
var track = TestEntities.LocalTrack(owner);
await SeedAsync(owner, track);
var history = Assert.Single(await Database.ListeningHistories.ToListAsync(TestContext.Current.CancellationToken));
Assert.Equal(7, history.UserId);
Assert.Equal(track.Id, history.TrackId);
}
var response = await CreateIssuer().IssueAsync(track.Id, "folder-42", userId: 7, TestContext.Current.CancellationToken);
[Fact]
public async Task IssueAsync_PassesTheProcessedAudioKeyPrefixToTheTicketService()
{
ticketService.IssueTicket(Arg.Any<long>(), Arg.Any<string>()).Returns(new StreamTicket("token", 60));
var owner = TestEntities.User(1);
var track = TestEntities.LocalTrack(owner);
await SeedAsync(owner, track);
Assert.Equal("signed-token", response.Ticket);
Assert.Equal(120, response.ExpiresInSeconds);
Assert.Equal(
"https://stream.musify.test/media/Tracks/ProcessedAudios/folder-42/audio.m4a",
response.ManifestUrl);
await CreateIssuer().IssueAsync(track.Id, "folder-42", userId: 1, TestContext.Current.CancellationToken);
var history = Assert.Single(await Database.ListeningHistories.ToListAsync(TestContext.Current.CancellationToken));
Assert.Equal(7, history.UserId);
Assert.Equal(track.Id, history.TrackId);
}
ticketService.Received(1).IssueTicket(1, "Tracks/ProcessedAudios/folder-42/");
[Fact]
public async Task IssueAsync_PassesTheProcessedAudioKeyPrefixToTheTicketService()
{
ticketService.IssueTicket(Arg.Any<long>(), Arg.Any<string>()).Returns(new StreamTicket("token", 60));
var owner = TestEntities.User(1);
var track = TestEntities.LocalTrack(owner);
await SeedAsync(owner, track);
await CreateIssuer().IssueAsync(track.Id, "folder-42", userId: 1, TestContext.Current.CancellationToken);
ticketService.Received(1).IssueTicket(1, "Tracks/ProcessedAudios/folder-42/");
}
}
}
@@ -6,140 +6,141 @@ using Musify.Domain.ValueObjects;
using NSubstitute;
using Xunit;
namespace Musify.Application.Tests.Services;
public sealed class UploadIntentValidatorTests : HandlerTestBase
namespace Musify.Application.Tests.Services
{
private readonly IStorageService storageService = Substitute.For<IStorageService>();
private readonly Domain.Entities.User owner = TestEntities.User();
private UploadIntentValidator CreateValidator() => new(Database, storageService);
[Fact]
public async Task ValidateAndLoadAsync_UploadedObjectWithinLimits_ReturnsTheIntent()
public sealed class UploadIntentValidatorTests : HandlerTestBase
{
storageService
.HeadObjectAsync("bucket", "temp/object.webp", Arg.Any<CancellationToken>())
.Returns(new ObjectMetaData("image/webp", 2048));
private readonly IStorageService storageService = Substitute.For<IStorageService>();
private readonly Domain.Entities.User owner = TestEntities.User();
var intent = TestEntities.UploadIntent(owner.Id, bucket: "bucket", key: "temp/object.webp");
await SeedAsync(owner, intent);
private UploadIntentValidator CreateValidator() => new(Database, storageService);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
[Fact]
public async Task ValidateAndLoadAsync_UploadedObjectWithinLimits_ReturnsTheIntent()
{
storageService
.HeadObjectAsync("bucket", "temp/object.webp", Arg.Any<CancellationToken>())
.Returns(new ObjectMetaData("image/webp", 2048));
Assert.False(result.IsError);
Assert.Equal(intent.Id, result.Value.Id);
}
var intent = TestEntities.UploadIntent(owner.Id, bucket: "bucket", key: "temp/object.webp");
await SeedAsync(owner, intent);
[Fact]
public async Task ValidateAndLoadAsync_IntentMissing_ReturnsNotFound()
{
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), Guid.NewGuid(), owner.Id, TestContext.Current.CancellationToken);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
Assert.Equal(ErrorType.NotFound, result.FirstError.Type);
}
Assert.False(result.IsError);
Assert.Equal(intent.Id, result.Value.Id);
}
[Fact]
public async Task ValidateAndLoadAsync_IntentBelongsToAnotherUser_ReturnsNotFound()
{
var stranger = TestEntities.User(2, "stranger");
var intent = TestEntities.UploadIntent(owner.Id);
await SeedAsync(owner, stranger, intent);
[Fact]
public async Task ValidateAndLoadAsync_IntentMissing_ReturnsNotFound()
{
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), Guid.NewGuid(), owner.Id, TestContext.Current.CancellationToken);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, stranger.Id, TestContext.Current.CancellationToken);
Assert.Equal(ErrorType.NotFound, result.FirstError.Type);
}
Assert.Equal(ErrorType.NotFound, result.FirstError.Type);
}
[Fact]
public async Task ValidateAndLoadAsync_IntentBelongsToAnotherUser_ReturnsNotFound()
{
var stranger = TestEntities.User(2, "stranger");
var intent = TestEntities.UploadIntent(owner.Id);
await SeedAsync(owner, stranger, intent);
[Fact]
public async Task ValidateAndLoadAsync_AlreadyConsumed_ReturnsConflict()
{
var intent = TestEntities.UploadIntent(owner.Id, status: UploadIntentStatus.Consumed);
await SeedAsync(owner, intent);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, stranger.Id, TestContext.Current.CancellationToken);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
Assert.Equal(ErrorType.NotFound, result.FirstError.Type);
}
Assert.Equal(ErrorType.Conflict, result.FirstError.Type);
}
[Fact]
public async Task ValidateAndLoadAsync_AlreadyConsumed_ReturnsConflict()
{
var intent = TestEntities.UploadIntent(owner.Id, status: UploadIntentStatus.Consumed);
await SeedAsync(owner, intent);
[Fact]
public async Task ValidateAndLoadAsync_PastExpiry_ReturnsValidationError()
{
var intent = TestEntities.UploadIntent(owner.Id, expiresAt: DateTime.UtcNow.AddMinutes(-1));
await SeedAsync(owner, intent);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
Assert.Equal(ErrorType.Conflict, result.FirstError.Type);
}
Assert.Equal(ErrorType.Validation, result.FirstError.Type);
}
[Fact]
public async Task ValidateAndLoadAsync_PastExpiry_ReturnsValidationError()
{
var intent = TestEntities.UploadIntent(owner.Id, expiresAt: DateTime.UtcNow.AddMinutes(-1));
await SeedAsync(owner, intent);
[Fact]
public async Task ValidateAndLoadAsync_ObjectNeverUploaded_ReturnsNotFound()
{
storageService
.HeadObjectAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<CancellationToken>())
.Returns((ObjectMetaData?)null);
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
var intent = TestEntities.UploadIntent(owner.Id);
await SeedAsync(owner, intent);
Assert.Equal(ErrorType.Validation, result.FirstError.Type);
}
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
[Fact]
public async Task ValidateAndLoadAsync_ObjectNeverUploaded_ReturnsNotFound()
{
storageService
.HeadObjectAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<CancellationToken>())
.Returns((ObjectMetaData?)null);
Assert.Equal(ErrorType.NotFound, result.FirstError.Type);
}
var intent = TestEntities.UploadIntent(owner.Id);
await SeedAsync(owner, intent);
[Fact]
public async Task ValidateAndLoadAsync_UploadedObjectExceedsMaxSize_ReturnsValidationError()
{
var config = TestConfigurations.UploadIntent();
config.MaxUploadBytes = 1024;
var result = await CreateValidator().ValidateAndLoadAsync(TestConfigurations.UploadIntent(), intent.Id, owner.Id, TestContext.Current.CancellationToken);
storageService
.HeadObjectAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<CancellationToken>())
.Returns(new ObjectMetaData("image/webp", 2048));
Assert.Equal(ErrorType.NotFound, result.FirstError.Type);
}
var intent = TestEntities.UploadIntent(owner.Id);
await SeedAsync(owner, intent);
[Fact]
public async Task ValidateAndLoadAsync_UploadedObjectExceedsMaxSize_ReturnsValidationError()
{
var config = TestConfigurations.UploadIntent();
config.MaxUploadBytes = 1024;
var result = await CreateValidator().ValidateAndLoadAsync(config, intent.Id, owner.Id, TestContext.Current.CancellationToken);
storageService
.HeadObjectAsync(Arg.Any<string>(), Arg.Any<string>(), Arg.Any<CancellationToken>())
.Returns(new ObjectMetaData("image/webp", 2048));
Assert.Equal(ErrorType.Validation, result.FirstError.Type);
}
var intent = TestEntities.UploadIntent(owner.Id);
await SeedAsync(owner, intent);
[Fact]
public async Task CheckQuotaAsync_WithinLimits_ReturnsSuccess()
{
await SeedAsync(owner);
var result = await CreateValidator().ValidateAndLoadAsync(config, intent.Id, owner.Id, TestContext.Current.CancellationToken);
var result = await CreateValidator().CheckQuotaAsync(TestConfigurations.UploadIntent(), owner.Id, requiredBytes: 1024, requiredIntentCount: 1, TestContext.Current.CancellationToken);
Assert.Equal(ErrorType.Validation, result.FirstError.Type);
}
Assert.False(result.IsError);
}
[Fact]
public async Task CheckQuotaAsync_WithinLimits_ReturnsSuccess()
{
await SeedAsync(owner);
[Fact]
public async Task CheckQuotaAsync_TooManyActiveIntents_ReturnsValidationError()
{
var config = TestConfigurations.UploadIntent();
config.MaxActiveUploadIntentsPerUser = 1;
await SeedAsync(owner, TestEntities.UploadIntent(owner.Id));
var result = await CreateValidator().CheckQuotaAsync(TestConfigurations.UploadIntent(), owner.Id, requiredBytes: 1024, requiredIntentCount: 1, TestContext.Current.CancellationToken);
var result = await CreateValidator().CheckQuotaAsync(config, owner.Id, requiredBytes: 1, requiredIntentCount: 1, TestContext.Current.CancellationToken);
Assert.False(result.IsError);
}
Assert.Equal(ErrorType.Validation, result.FirstError.Type);
}
[Fact]
public async Task CheckQuotaAsync_TooManyActiveIntents_ReturnsValidationError()
{
var config = TestConfigurations.UploadIntent();
config.MaxActiveUploadIntentsPerUser = 1;
await SeedAsync(owner, TestEntities.UploadIntent(owner.Id));
[Fact]
public async Task CheckQuotaAsync_ExpiredOrConsumedIntentsDoNotCountTowardsTheLimit()
{
var config = TestConfigurations.UploadIntent();
config.MaxActiveUploadIntentsPerUser = 1;
await SeedAsync(
owner,
TestEntities.UploadIntent(owner.Id, status: UploadIntentStatus.Expired),
TestEntities.UploadIntent(owner.Id, status: UploadIntentStatus.Consumed));
var result = await CreateValidator().CheckQuotaAsync(config, owner.Id, requiredBytes: 1, requiredIntentCount: 1, TestContext.Current.CancellationToken);
var result = await CreateValidator().CheckQuotaAsync(config, owner.Id, requiredBytes: 1, requiredIntentCount: 1, TestContext.Current.CancellationToken);
Assert.Equal(ErrorType.Validation, result.FirstError.Type);
}
Assert.False(result.IsError);
[Fact]
public async Task CheckQuotaAsync_ExpiredOrConsumedIntentsDoNotCountTowardsTheLimit()
{
var config = TestConfigurations.UploadIntent();
config.MaxActiveUploadIntentsPerUser = 1;
await SeedAsync(
owner,
TestEntities.UploadIntent(owner.Id, status: UploadIntentStatus.Expired),
TestEntities.UploadIntent(owner.Id, status: UploadIntentStatus.Consumed));
var result = await CreateValidator().CheckQuotaAsync(config, owner.Id, requiredBytes: 1, requiredIntentCount: 1, TestContext.Current.CancellationToken);
Assert.False(result.IsError);
}
}
}
@@ -5,99 +5,100 @@ using Musify.Application.Tests.TestSupport;
using NSubstitute;
using Xunit;
namespace Musify.Application.Tests.Services;
public sealed class YouTubeTrackProvisionerTests : HandlerTestBase
namespace Musify.Application.Tests.Services
{
private readonly IYouTubeMusicService youTubeMusicService = Substitute.For<IYouTubeMusicService>();
private YouTubeTrackProvisioner CreateProvisioner() =>
new(Database, youTubeMusicService, TestConfigurations.Track(), NoOpLogger<YouTubeTrackProvisioner>());
[Fact]
public async Task FindAsync_UnknownVideo_ReturnsNull()
public sealed class YouTubeTrackProvisionerTests : HandlerTestBase
{
var track = await CreateProvisioner().FindAsync("missing-video", TestContext.Current.CancellationToken);
private readonly IYouTubeMusicService youTubeMusicService = Substitute.For<IYouTubeMusicService>();
Assert.Null(track);
}
private YouTubeTrackProvisioner CreateProvisioner() =>
new(Database, youTubeMusicService, TestConfigurations.Track(), NoOpLogger<YouTubeTrackProvisioner>());
[Fact]
public async Task GetOrCreateAsync_KnownVideo_ReturnsExistingTrackWithoutCallingTheService()
{
var existing = TestEntities.ExternalTrack(externalId: "known-video");
await SeedAsync(existing);
[Fact]
public async Task FindAsync_UnknownVideo_ReturnsNull()
{
var track = await CreateProvisioner().FindAsync("missing-video", TestContext.Current.CancellationToken);
var result = await CreateProvisioner().GetOrCreateAsync("known-video", TestContext.Current.CancellationToken);
Assert.Null(track);
}
Assert.False(result.IsError);
Assert.Equal(existing.Id, result.Value.Track.Id);
await youTubeMusicService.DidNotReceiveWithAnyArgs().GetSongAsync(default!, TestContext.Current.CancellationToken);
}
[Fact]
public async Task GetOrCreateAsync_KnownVideo_ReturnsExistingTrackWithoutCallingTheService()
{
var existing = TestEntities.ExternalTrack(externalId: "known-video");
await SeedAsync(existing);
[Fact]
public async Task GetOrCreateAsync_NewVideo_CreatesTrackAndDeduplicatesArtistsByName()
{
youTubeMusicService.GetSongAsync("new-video", Arg.Any<CancellationToken>()).Returns(
new YouTubeSongResult(
"new-video", "New Song", "New Artist", "Album", 210, "https://img/thumb.jpg", false,
[new YouTubeArtistRef(null, "New Artist"), new YouTubeArtistRef(null, "new artist")]));
var result = await CreateProvisioner().GetOrCreateAsync("known-video", TestContext.Current.CancellationToken);
var result = await CreateProvisioner().GetOrCreateAsync("new-video", TestContext.Current.CancellationToken);
Assert.False(result.IsError);
Assert.Equal(existing.Id, result.Value.Track.Id);
await youTubeMusicService.DidNotReceiveWithAnyArgs().GetSongAsync(default!, TestContext.Current.CancellationToken);
}
Assert.False(result.IsError);
Assert.Equal("New Song", result.Value.Track.Title);
Assert.Single(await Database.Artists.ToListAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.TrackArtists.ToListAsync(TestContext.Current.CancellationToken));
}
[Fact]
public async Task GetOrCreateAsync_NewVideo_CreatesTrackAndDeduplicatesArtistsByName()
{
youTubeMusicService.GetSongAsync("new-video", Arg.Any<CancellationToken>()).Returns(
new YouTubeSongResult(
"new-video", "New Song", "New Artist", "Album", 210, "https://img/thumb.jpg", false,
[new YouTubeArtistRef(null, "New Artist"), new YouTubeArtistRef(null, "new artist")]));
[Fact]
public async Task GetOrCreateAsync_ServiceFails_ReturnsError()
{
youTubeMusicService.GetSongAsync("bad-video", Arg.Any<CancellationToken>())
.Returns(ErrorOr.Error.NotFound(description: "Video not found"));
var result = await CreateProvisioner().GetOrCreateAsync("new-video", TestContext.Current.CancellationToken);
var result = await CreateProvisioner().GetOrCreateAsync("bad-video", TestContext.Current.CancellationToken);
Assert.False(result.IsError);
Assert.Equal("New Song", result.Value.Track.Title);
Assert.Single(await Database.Artists.ToListAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.TrackArtists.ToListAsync(TestContext.Current.CancellationToken));
}
Assert.True(result.IsError);
}
[Fact]
public async Task GetOrCreateAsync_ServiceFails_ReturnsError()
{
youTubeMusicService.GetSongAsync("bad-video", Arg.Any<CancellationToken>())
.Returns(ErrorOr.Error.NotFound(description: "Video not found"));
[Fact]
public async Task MaterializeAlbumAsync_NewAlbum_CreatesAlbumTracksAndLinks()
{
var detail = new YouTubeAlbumDetail(
new YouTubeAlbumResult("album-1", "Album Title", "Album Artist", "https://img/thumb.jpg", 2024, false, false,
[new YouTubeArtistRef(null, "Album Artist")]),
Description: "desc",
TotalDurationSeconds: 400,
Tracks:
[
new YouTubeAlbumTrack("track-1", "Track One", 200, 1, false),
new YouTubeAlbumTrack("track-2", "Track Two", 200, 2, false)
]);
var result = await CreateProvisioner().GetOrCreateAsync("bad-video", TestContext.Current.CancellationToken);
await CreateProvisioner().MaterializeAlbumAsync("album-1", detail, TestContext.Current.CancellationToken);
Assert.True(result.IsError);
}
Assert.Equal(2, await Database.ExternalTracks.CountAsync(TestContext.Current.CancellationToken));
Assert.Equal(2, await Database.AlbumHasTracks.CountAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.ExternalAlbums.ToListAsync(TestContext.Current.CancellationToken));
}
[Fact]
public async Task MaterializeAlbumAsync_NewAlbum_CreatesAlbumTracksAndLinks()
{
var detail = new YouTubeAlbumDetail(
new YouTubeAlbumResult("album-1", "Album Title", "Album Artist", "https://img/thumb.jpg", 2024, false, false,
[new YouTubeArtistRef(null, "Album Artist")]),
Description: "desc",
TotalDurationSeconds: 400,
Tracks:
[
new YouTubeAlbumTrack("track-1", "Track One", 200, 1, false),
new YouTubeAlbumTrack("track-2", "Track Two", 200, 2, false)
]);
[Fact]
public async Task MaterializeAlbumAsync_CalledTwice_DoesNotDuplicateTracksOrLinks()
{
var detail = new YouTubeAlbumDetail(
new YouTubeAlbumResult("album-1", "Album Title", "Album Artist", "https://img/thumb.jpg", 2024, false, false, []),
Description: "desc",
TotalDurationSeconds: 200,
Tracks: [new YouTubeAlbumTrack("track-1", "Track One", 200, 1, false)]);
await CreateProvisioner().MaterializeAlbumAsync("album-1", detail, TestContext.Current.CancellationToken);
var provisioner = CreateProvisioner();
await provisioner.MaterializeAlbumAsync("album-1", detail, TestContext.Current.CancellationToken);
await provisioner.MaterializeAlbumAsync("album-1", detail, TestContext.Current.CancellationToken);
Assert.Equal(2, await Database.ExternalTracks.CountAsync(TestContext.Current.CancellationToken));
Assert.Equal(2, await Database.AlbumHasTracks.CountAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.ExternalAlbums.ToListAsync(TestContext.Current.CancellationToken));
}
Assert.Single(await Database.ExternalTracks.ToListAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.AlbumHasTracks.ToListAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.ExternalAlbums.ToListAsync(TestContext.Current.CancellationToken));
[Fact]
public async Task MaterializeAlbumAsync_CalledTwice_DoesNotDuplicateTracksOrLinks()
{
var detail = new YouTubeAlbumDetail(
new YouTubeAlbumResult("album-1", "Album Title", "Album Artist", "https://img/thumb.jpg", 2024, false, false, []),
Description: "desc",
TotalDurationSeconds: 200,
Tracks: [new YouTubeAlbumTrack("track-1", "Track One", 200, 1, false)]);
var provisioner = CreateProvisioner();
await provisioner.MaterializeAlbumAsync("album-1", detail, TestContext.Current.CancellationToken);
await provisioner.MaterializeAlbumAsync("album-1", detail, TestContext.Current.CancellationToken);
Assert.Single(await Database.ExternalTracks.ToListAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.AlbumHasTracks.ToListAsync(TestContext.Current.CancellationToken));
Assert.Single(await Database.ExternalAlbums.ToListAsync(TestContext.Current.CancellationToken));
}
}
}