diff --git a/LyricsScraperNET/Extensions/SearchResultExtensions.cs b/LyricsScraperNET/Extensions/SearchResultExtensions.cs index 97b7ce5..88887b5 100644 --- a/LyricsScraperNET/Extensions/SearchResultExtensions.cs +++ b/LyricsScraperNET/Extensions/SearchResultExtensions.cs @@ -32,6 +32,7 @@ internal static SearchResult AppendResponseMessage(this SearchResult searchResul internal static SearchResult AddInstrumental(this SearchResult searchResult, bool instrumental) { + searchResult.ResponseStatusCode = ResponseStatusCode.Success; searchResult.Instrumental = instrumental; return searchResult; } diff --git a/LyricsScraperNET/LyricsScraperClient.cs b/LyricsScraperNET/LyricsScraperClient.cs index 49b0f62..a8c90f3 100644 --- a/LyricsScraperNET/LyricsScraperClient.cs +++ b/LyricsScraperNET/LyricsScraperClient.cs @@ -70,7 +70,7 @@ public SearchResult SearchLyric(SearchRequest searchRequest) foreach (var externalProvider in GetAvailableProvidersForSearchRequest(searchRequest)) { var providerSearchResult = externalProvider.SearchLyric(searchRequest); - if (!providerSearchResult.IsEmpty()) + if (!providerSearchResult.IsEmpty() || providerSearchResult.Instrumental) { return providerSearchResult; } @@ -102,7 +102,7 @@ public async Task SearchLyricAsync(SearchRequest searchRequest) foreach (var externalProvider in GetAvailableProvidersForSearchRequest(searchRequest)) { var providerSearchResult = await externalProvider.SearchLyricAsync(searchRequest); - if (!providerSearchResult.IsEmpty()) + if (!providerSearchResult.IsEmpty() || providerSearchResult.Instrumental) { return providerSearchResult; } diff --git a/Tests/LyricsScraperNET.IntegrationTest/LyricsScraperNET.IntegrationTest.csproj b/Tests/LyricsScraperNET.IntegrationTest/LyricsScraperNET.IntegrationTest.csproj index 9bb552d..d1dc790 100644 --- a/Tests/LyricsScraperNET.IntegrationTest/LyricsScraperNET.IntegrationTest.csproj +++ b/Tests/LyricsScraperNET.IntegrationTest/LyricsScraperNET.IntegrationTest.csproj @@ -40,28 +40,28 @@ PreserveNewest - + PreserveNewest PreserveNewest - + PreserveNewest PreserveNewest - + PreserveNewest - + PreserveNewest PreserveNewest - + PreserveNewest diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/AZLyricsProviderTest.cs b/Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/AZLyricsProviderTest.cs index ea8b49a..2ae5f40 100644 --- a/Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/AZLyricsProviderTest.cs +++ b/Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/AZLyricsProviderTest.cs @@ -11,8 +11,8 @@ namespace LyricsScraperNET.IntegrationTest.Providers.AZLyrics public class AZLyricsProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\AZLyrics\\test_data.json")] - public void SearchLyric_IntegrationDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\AZLyrics\\lyric_test_data.json")] + public void SearchLyric_IntegrationDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new AZLyricsProvider(); diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/test_data.json b/Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/test_data.json rename to Tests/LyricsScraperNET.IntegrationTest/Providers/AZLyrics/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/GeniusProviderTest.cs b/Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/GeniusProviderTest.cs index fce24f2..050cb35 100644 --- a/Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/GeniusProviderTest.cs +++ b/Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/GeniusProviderTest.cs @@ -11,8 +11,8 @@ namespace LyricsScraperNET.IntegrationTest.Providers.Genius public class GeniusProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\Genius\\test_data.json")] - public void SearchLyric_IntegrationDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\Genius\\lyric_test_data.json")] + public void SearchLyric_IntegrationDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new GeniusProvider(); diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/test_data.json b/Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/test_data.json rename to Tests/LyricsScraperNET.IntegrationTest/Providers/Genius/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/LyricFindProviderTest.cs b/Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/LyricFindProviderTest.cs index e0fcb4e..08696a7 100644 --- a/Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/LyricFindProviderTest.cs +++ b/Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/LyricFindProviderTest.cs @@ -11,8 +11,8 @@ namespace LyricsScraperNET.IntegrationTest.Providers.LyricFind public class LyricFindProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\LyricFind\\test_data.json")] - public void SearchLyric_IntegrationDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\LyricFind\\lyric_test_data.json")] + public void SearchLyric_IntegrationDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new LyricFindProvider(); diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/test_data.json b/Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/test_data.json rename to Tests/LyricsScraperNET.IntegrationTest/Providers/LyricFind/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs b/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs index 28b0e12..0d2e8e3 100644 --- a/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs +++ b/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs @@ -11,8 +11,8 @@ namespace LyricsScraperNET.IntegrationTest.Providers.Musixmatch public class MusixmatchProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\Musixmatch\\test_data.json")] - public void SearchLyric_IntegrationDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\Musixmatch\\lyric_test_data.json")] + public void SearchLyric_IntegrationDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new MusixmatchProvider(); diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/test_data.json b/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/test_data.json rename to Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/SongLyricsProviderTest.cs b/Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/SongLyricsProviderTest.cs index 791c10b..2d1be2b 100644 --- a/Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/SongLyricsProviderTest.cs +++ b/Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/SongLyricsProviderTest.cs @@ -11,8 +11,8 @@ namespace LyricsScraperNET.IntegrationTest.Providers.SongLyrics public class SongLyricsProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\SongLyrics\\test_data.json")] - public void SearchLyric_IntegrationDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\SongLyrics\\lyric_test_data.json")] + public void SearchLyric_IntegrationDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new SongLyricsProvider(); diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/test_data.json b/Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/test_data.json rename to Tests/LyricsScraperNET.IntegrationTest/Providers/SongLyrics/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.UnitTest/LyricsScraperNET.UnitTest.csproj b/Tests/LyricsScraperNET.UnitTest/LyricsScraperNET.UnitTest.csproj index 82547a7..c73f5ac 100644 --- a/Tests/LyricsScraperNET.UnitTest/LyricsScraperNET.UnitTest.csproj +++ b/Tests/LyricsScraperNET.UnitTest/LyricsScraperNET.UnitTest.csproj @@ -37,7 +37,7 @@ PreserveNewest - + PreserveNewest @@ -46,7 +46,7 @@ PreserveNewest - + PreserveNewest @@ -55,7 +55,7 @@ PreserveNewest - + PreserveNewest @@ -64,7 +64,7 @@ PreserveNewest - + PreserveNewest diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/AZLyricsProviderTest.cs b/Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/AZLyricsProviderTest.cs index 19e76e4..65052e5 100644 --- a/Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/AZLyricsProviderTest.cs +++ b/Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/AZLyricsProviderTest.cs @@ -12,8 +12,8 @@ namespace LyricsScraperNET.UnitTest.Providers.AZLyrics public class AZLyricsProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\AZLyrics\\test_data.json")] - public void SearchLyric_UnitDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\AZLyrics\\lyric_test_data.json")] + public void SearchLyric_UnitDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new AZLyricsProvider(); diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/test_data.json b/Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/test_data.json rename to Tests/LyricsScraperNET.UnitTest/Providers/AZLyrics/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/Genius/GeniusProviderTest.cs b/Tests/LyricsScraperNET.UnitTest/Providers/Genius/GeniusProviderTest.cs index 535d053..ee361a2 100644 --- a/Tests/LyricsScraperNET.UnitTest/Providers/Genius/GeniusProviderTest.cs +++ b/Tests/LyricsScraperNET.UnitTest/Providers/Genius/GeniusProviderTest.cs @@ -12,8 +12,8 @@ namespace LyricsScraperNET.UnitTest.Providers.Genius public class GeniusProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\Genius\\test_data.json")] - public void SearchLyric_UnitDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\Genius\\lyric_test_data.json")] + public void SearchLyric_UnitDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new GeniusProvider(); diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/Genius/test_data.json b/Tests/LyricsScraperNET.UnitTest/Providers/Genius/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.UnitTest/Providers/Genius/test_data.json rename to Tests/LyricsScraperNET.UnitTest/Providers/Genius/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/LyricFindProviderTest.cs b/Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/LyricFindProviderTest.cs index ec8746c..d73aaee 100644 --- a/Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/LyricFindProviderTest.cs +++ b/Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/LyricFindProviderTest.cs @@ -12,8 +12,8 @@ namespace LyricsScraperNET.UnitTest.Providers.LyricFind public class LyricFindProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\LyricFind\\test_data.json")] - public void SearchLyric_UnitDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\LyricFind\\lyric_test_data.json")] + public void SearchLyric_UnitDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new LyricFindProvider(); diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/test_data.json b/Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/test_data.json rename to Tests/LyricsScraperNET.UnitTest/Providers/LyricFind/lyric_test_data.json diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/SongLyricsProviderTest.cs b/Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/SongLyricsProviderTest.cs index b22a8aa..e24b44c 100644 --- a/Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/SongLyricsProviderTest.cs +++ b/Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/SongLyricsProviderTest.cs @@ -12,8 +12,8 @@ namespace LyricsScraperNET.UnitTest.Providers.SongLyrics public class SongLyricsProviderTest : ProviderTestBase { [Theory] - [MemberData(nameof(GetTestData), parameters: "Providers\\SongLyrics\\test_data.json")] - public void SearchLyric_UnitDynamicData_AreEqual(LyricsTestData testData) + [MemberData(nameof(GetTestData), parameters: "Providers\\SongLyrics\\lyric_test_data.json")] + public void SearchLyric_UnitDynamicData_Success(LyricsTestData testData) { // Arrange var lyricsClient = new SongLyricsProvider(); diff --git a/Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/test_data.json b/Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/lyric_test_data.json similarity index 100% rename from Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/test_data.json rename to Tests/LyricsScraperNET.UnitTest/Providers/SongLyrics/lyric_test_data.json