public void GetSongInfo_NullStoreUrlCase_ReturnsCorrectInfo() { GetSongService gs = new GetSongService("Hits"); var result = gs.GetSongInfo().Result; Assert.AreEqual(result.Title, "Invader Invader"); Assert.AreEqual(result.Artist, "Kyarypamyupamyu"); Assert.IsNull(result.StoreUrl); Assert.AreEqual(result.CoverUrl, "https://j1fm.com/images/no_cd.jpg"); }
public void GetSongInfo_NotNullStoreUrlCase_ReturnsCorrectInfo() { GetSongService gs = new GetSongService("Hits"); var result = gs.GetSongInfo().Result; Assert.AreEqual(result.Title, "Angel Enjite 20nen"); Assert.AreEqual(result.Artist, "Up Up Girls (2)"); Assert.AreEqual(result.StoreUrl, "https://a.j1fm.com/?TPRC-205"); Assert.AreEqual(result.CoverUrl, "https://j1fm.tokyo/c/T/TPRC-205.jpg"); }
public async Task DoWork() { GetSongService service = new GetSongService(Channel); Info = await service.GetSongInfo(); if (FileToAppend != null && File.Exists(FileToAppend)) { var appendFormat = "{0} - {1} @ {2}"; var appendContent = string.Format(appendFormat, Info.Artist, Info.Title, Info.StoreUrl); File.AppendAllText(FileToAppend, appendContent + Environment.NewLine, Encoding.Unicode); } }