public void TestEmpty() { LyricsCache cache = new LyricsCache(); Song s1 = new TestSong("title", "artist", "album", "genre"); Assert.IsNull(cache.GetLyrics(s1)); }
public void TestCaching() { LyricsCache cache = new LyricsCache(); Song s1 = new TestSong("title", "artist", "album", "genre"); s1.Lyrics = "the new lyrics"; Song s2 = new TestSong("title2", "artist2", "album", "genre"); s2.Lyrics = "something else2"; Assert.IsNull(cache.GetLyrics(s1)); Assert.IsNull(cache.GetLyrics(s2)); cache.PutLyrics(s1); cache.PutLyrics(s2); Assert.AreEqual(s1.Lyrics, cache.GetLyrics(s1)); Assert.AreEqual(s2.Lyrics, cache.GetLyrics(s2)); }