Lisoveliy aebe654c38
Some checks are pending
Deploy / update (push) Waiting to run
Build Project .NET / build (push) Waiting to run
chore: init commit from GitHub
2025-05-12 19:44:33 +03:00

26 lines
919 B
C#

using FluentAssertions;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using SWAD.API.Models.Config.ApiServices;
using SWAD.API.Services.MusicAPI.Auth;
namespace ApiTest.MusicApi;
public class Spotify
{
[Test]
public async Task SpotifyAuthTest()
{
var confbuilder = new ConfigurationBuilder().SetBasePath(Environment.CurrentDirectory)
.AddJsonFile("appsettings.json")
.Build().GetSection(ApiServicesConfig.ConfigName);
//throw new Exception(Environment.CurrentDirectory);
IOptions<ApiServicesConfig> config = new OptionsWrapper<ApiServicesConfig>(confbuilder.Get<ApiServicesConfig>());
var authService = new SpotifyAuthService(config);
var authResponse = await authService.GetToken();
authResponse.Should()
.NotBeNull();
authResponse.Token.Should()
.NotBeNull();
}
}