chore: init commit from GitHub
This commit is contained in:
26
ApiTest/MusicApi/Spotify.cs
Normal file
26
ApiTest/MusicApi/Spotify.cs
Normal file
@@ -0,0 +1,26 @@
|
||||
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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user