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 config = new OptionsWrapper(confbuilder.Get()); var authService = new SpotifyAuthService(config); var authResponse = await authService.GetToken(); authResponse.Should() .NotBeNull(); authResponse.Token.Should() .NotBeNull(); } }