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).
60 lines
1.9 KiB
C#
60 lines
1.9 KiB
C#
using ErrorOr;
|
|
using Musify.Infrastructure.Services;
|
|
using Xunit;
|
|
|
|
namespace Musify.Infrastructure.Tests.Services
|
|
{
|
|
public sealed class DisabledYouTubeMusicServiceTests
|
|
{
|
|
private readonly DisabledYouTubeMusicService service = new();
|
|
|
|
[Fact]
|
|
public async Task SearchSongsAsync_ReturnsForbidden()
|
|
{
|
|
var result = await service.SearchSongsAsync("query", string.Empty, TestContext.Current.CancellationToken);
|
|
|
|
Assert.Equal(ErrorType.Forbidden, result.FirstError.Type);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task SearchAlbumsAsync_ReturnsForbidden()
|
|
{
|
|
var result = await service.SearchAlbumsAsync("query", string.Empty, TestContext.Current.CancellationToken);
|
|
|
|
Assert.Equal(ErrorType.Forbidden, result.FirstError.Type);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetAlbumAsync_ReturnsForbidden()
|
|
{
|
|
var result = await service.GetAlbumAsync("album-1", TestContext.Current.CancellationToken);
|
|
|
|
Assert.Equal(ErrorType.Forbidden, result.FirstError.Type);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetAudioStreamAsync_ReturnsForbidden()
|
|
{
|
|
var result = await service.GetAudioStreamAsync("video-1", TestContext.Current.CancellationToken);
|
|
|
|
Assert.Equal(ErrorType.Forbidden, result.FirstError.Type);
|
|
}
|
|
|
|
[Fact]
|
|
public async Task GetSongAsync_ReturnsForbidden()
|
|
{
|
|
var result = await service.GetSongAsync("video-1", TestContext.Current.CancellationToken);
|
|
|
|
Assert.Equal(ErrorType.Forbidden, result.FirstError.Type);
|
|
}
|
|
|
|
[Fact]
|
|
public void ResolveArtworkUrl_ReturnsTheUrlUnchanged()
|
|
{
|
|
var result = service.ResolveArtworkUrl("https://img.example/thumb.jpg");
|
|
|
|
Assert.Equal("https://img.example/thumb.jpg", result);
|
|
}
|
|
}
|
|
}
|