diff --git a/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs b/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs index c751a34..cf5af1c 100644 --- a/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs +++ b/Tests/LyricsScraperNET.IntegrationTest/Providers/Musixmatch/MusixmatchProviderTest.cs @@ -31,7 +31,7 @@ public void SearchLyric_IntegrationDynamicData_AreEqual(LyricsTestData testData) Assert.IsNotNull(searchResult); Assert.IsFalse(searchResult.IsEmpty()); Assert.AreEqual(ExternalProviderType.Musixmatch, searchResult.ExternalProviderType); - Assert.AreEqual(testData.LyricResultData, searchResult.LyricText); + Assert.AreEqual(testData.LyricResultData.Replace("\r\n", "\n"), searchResult.LyricText); } public static IEnumerable GetTestData() diff --git a/Tests/LyricsScraperNET.UnitTest/Extensions/StringExtensionsTest.cs b/Tests/LyricsScraperNET.UnitTest/Extensions/StringExtensionsTest.cs index 7aa918a..25133b6 100644 --- a/Tests/LyricsScraperNET.UnitTest/Extensions/StringExtensionsTest.cs +++ b/Tests/LyricsScraperNET.UnitTest/Extensions/StringExtensionsTest.cs @@ -10,6 +10,8 @@ public class StringExtensionsTest [DataRow("Attack Attack!", "attack-attack!")] [DataRow("I Swear I'll Change", "i-swear-i-ll-change")] [DataRow("You Can't Spell Crap Without \"C\"", "you-can-t-spell-crap-without-c")] + [DataRow("", "")] + [DataRow(null, null)] public void СonvertToDashedFormat_MultipleInputs_ShouldBeParse(string input, string expected) { // Act @@ -18,5 +20,37 @@ public void СonvertToDashedFormat_MultipleInputs_ShouldBeParse(string input, st // Assert Assert.AreEqual(expected, actual); } + + [DataTestMethod] + [DataRow("Attack Attack!", true, "attackattack")] + [DataRow("The Devil Wears Prada", true, "devilwearsprada")] + [DataRow("You Can't Spell Crap Without 'C'", false, "youcantspellcrapwithoutc")] + [DataRow("Sound The Alarm", false, "soundthealarm")] + [DataRow("", true, "")] + [DataRow(null, true, null)] + public void StripRedundantChars_MultipleInputs_ShouldBeParse(string input, bool removeArticles, string expected) + { + // Act + var actual = StringExtensions.StripRedundantChars(input, removeArticles); + + // Assert + Assert.AreEqual(expected, actual); + } + + + [DataTestMethod] + [DataRow("
test
", "test")] + [DataRow("This text < is for fun", "This text < is for fun")] + [DataRow(">not deleted<", ">not deleted<")] + [DataRow("", "")] + [DataRow(null, null)] + public void RemoveHtmlTags_MultipleInputs_ShouldBeParse(string input, string expected) + { + // Act + var actual = StringExtensions.RemoveHtmlTags(input); + + // Assert + Assert.AreEqual(expected, actual); + } } }