Skip to content

Commit

Permalink
Rename test methods
Browse files Browse the repository at this point in the history
  • Loading branch information
geloczi committed Dec 19, 2021
1 parent 14bc2db commit fb63b2f
Showing 1 changed file with 33 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static void UpdateTestPlaylist()
}

[TestMethod]
public async Task ListArtists()
public async Task Artist_List()
{
var response = await AudioStation.ListArtistsAsync(TestPageSize, 0);
Assert.IsTrue(response.Success);
Expand All @@ -71,7 +71,7 @@ public async Task ListArtists()
}

[TestMethod]
public async Task ListAlbums()
public async Task Album_List()
{
var response = await AudioStation.ListAlbumsAsync(TestPageSize, 0);
Assert.IsTrue(response.Success);
Expand All @@ -81,7 +81,7 @@ public async Task ListAlbums()
}

[TestMethod]
public async Task ListLatestAlbums()
public async Task Album_ListLatest()
{
var response = await AudioStation.ListAlbumsAsync(TestPageSize, 0, null, (AlbumQueryParameter.sort_by, AlbumSortBy.Time), (AlbumQueryParameter.sort_direction, SortDirection.Descending));
Assert.IsTrue(response.Success);
Expand All @@ -92,7 +92,7 @@ public async Task ListLatestAlbums()
}

[TestMethod]
public async Task ListComposers()
public async Task Composer_List()
{
var response = await AudioStation.ListComposersAsync(TestPageSize, 0);
Assert.IsTrue(response.Success);
Expand All @@ -102,7 +102,7 @@ public async Task ListComposers()
}

[TestMethod]
public async Task ListGenres()
public async Task Genre_List()
{
var response = await AudioStation.ListGenresAsync(TestPageSize, 0);
Assert.IsTrue(response.Success);
Expand All @@ -112,15 +112,16 @@ public async Task ListGenres()
}

[TestMethod]
public async Task ListSongs_All() => await ListSongs(SongQueryAdditional.All);
public async Task Song_ListWithAll() => await ListSongs(SongQueryAdditional.All);
[TestMethod]
public async Task ListSongs_None() => await ListSongs(SongQueryAdditional.None);
public async Task Song_List() => await ListSongs(SongQueryAdditional.None);
[TestMethod]
public async Task ListSongs_song_audio() => await ListSongs(SongQueryAdditional.song_audio);
public async Task Song_ListWith_song_audio() => await ListSongs(SongQueryAdditional.song_audio);
[TestMethod]
public async Task ListSongs_song_rating() => await ListSongs(SongQueryAdditional.song_rating);
public async Task Song_ListWith_song_rating() => await ListSongs(SongQueryAdditional.song_rating);
[TestMethod]
public async Task ListSongs_song_tag() => await ListSongs(SongQueryAdditional.song_tag);
public async Task Song_ListWith_song_tag() => await ListSongs(SongQueryAdditional.song_tag);

private async Task ListSongs(SongQueryAdditional queryAdditional)
{
var response = await AudioStation.ListSongsAsync(TestPageSize, 0, queryAdditional);
Expand All @@ -143,7 +144,7 @@ private static void AssertIListResult(IApiListResponse lr)
}

[TestMethod]
public async Task ListSongsPagination()
public async Task Song_ListWithPagination()
{
var bigPage = await AudioStation.ListSongsAsync(100, 0, SongQueryAdditional.None);
AssertIListResult(bigPage);
Expand Down Expand Up @@ -172,7 +173,7 @@ public async Task ListSongsPagination()
}

[TestMethod]
public async Task ListArtistAlbumSongs()
public async Task Song_FilterByArtistAlbum()
{
var response = await AudioStation.ListSongsAsync(TestPageSize, 0, SongQueryAdditional.All,
(SongQueryParameter.artist, Config.TestArtist),
Expand Down Expand Up @@ -221,7 +222,7 @@ public async Task RateSong()
}

[TestMethod]
public async Task ListFolders()
public async Task Folder_List()
{
// Get top level folders
var response = await AudioStation.ListFoldersAsync(TestPageSize, 0);
Expand All @@ -240,7 +241,7 @@ public async Task ListFolders()
}

[TestMethod]
public async Task GetArtistCover()
public async Task Artist_GetCover()
{
var response = await AudioStation.GetArtistCoverAsync(Config.TestArtist);
Assert.IsFalse(response is null);
Expand All @@ -250,7 +251,7 @@ public async Task GetArtistCover()
}

[TestMethod]
public async Task GetArtistCover_NotFound()
public async Task Artist_GetCover_NotFound()
{
Exception exception = null;
try
Expand All @@ -268,7 +269,7 @@ public async Task GetArtistCover_NotFound()
}

[TestMethod]
public async Task GetAlbumCover()
public async Task Album_GetCover()
{
var response = await AudioStation.GetAlbumCoverAsync(Config.TestArtist, Config.TestAlbum);
Assert.IsFalse(response is null);
Expand All @@ -278,7 +279,7 @@ public async Task GetAlbumCover()
}

[TestMethod]
public async Task GetAlbumCover_NotFound()
public async Task Album_GetCover_NotFound()
{
Exception exception = null;
try
Expand All @@ -296,24 +297,32 @@ public async Task GetAlbumCover_NotFound()
}

[TestMethod]
public void TestStreamSong_MP3_320Kbps()
public async Task Song_GetById()
{
TestStreamSongInternal(TranscodeMode.MP3_320Kbps, "audio/mpeg");
var response = await AudioStation.GetSongByIdAsync(TestSong.ID);
Assert.IsTrue(response.Data.Songs.Length > 0);
Assert.AreEqual(response.Data.Songs[0].ID, TestSong.ID);
}

[TestMethod]
public void Song_Stream_MP3_320Kbps()
{
Song_StreamInternal(TranscodeMode.MP3_320Kbps, "audio/mpeg");
}

[TestMethod]
public void TestStreamSong_WAV()
public void Song_Stream_WAV()
{
TestStreamSongInternal(TranscodeMode.WAV, "audio/x-wav");
Song_StreamInternal(TranscodeMode.WAV, "audio/x-wav");
}

[TestMethod]
public void TestStreamSong_None()
public void Song_Stream_Original()
{
TestStreamSongInternal(TranscodeMode.None, null);
Song_StreamInternal(TranscodeMode.None, null);
}

private void TestStreamSongInternal(TranscodeMode transcodeMode, string mediaType)
private void Song_StreamInternal(TranscodeMode transcodeMode, string mediaType)
{
var tokenSource = new CancellationTokenSource();
var downloadTask = AudioStation.StreamSongAsync(
Expand Down Expand Up @@ -354,14 +363,6 @@ public async Task Search()
Assert.IsTrue(response.Data.SongTotal > 0);
}

[TestMethod]
public async Task GetSongById()
{
var response = await AudioStation.GetSongByIdAsync(TestSong.ID);
Assert.IsTrue(response.Data.Songs.Length > 0);
Assert.AreEqual(response.Data.Songs[0].ID, TestSong.ID);
}

[TestMethod]
public async Task Playlist_List()
{
Expand Down

0 comments on commit fb63b2f

Please sign in to comment.