public void GetSpotifyListeningHistoryWithInvalidAuthToken_ExceptionThrown() { sut = MakeSut(); var listeningHistory = sut.GetSpotifyRecentlyPlayed(new SpotifyAuthenticationToken()); listeningHistory.Result.Value.Should().NotBeNull(); listeningHistory.Result.Value.Should().NotBe(string.Empty); }
public void GetSpotifyListeningHistory_ListeningHistoryRetrieved() { sut = MakeSut(); var listeningHistory = sut.GetSpotifyRecentlyPlayed(spotifyAuthToken); listeningHistory.Result.Value.Should().NotBeNull(); listeningHistory.Result.Value.Should().NotBe(string.Empty); var listeningHistoryJson = JsonConvert.SerializeObject(listeningHistory.Result.Value); var actualListeningHistory = JsonConvert.DeserializeObject <CursorPaging <PlayHistoryItem> >(listeningHistoryJson); actualListeningHistory.Items.Should().HaveCount(3); actualListeningHistory.Items[0].Should().BeOfType <PlayHistoryItem>(); }
public void GetSpotifyListeningHistoryWithAfterParam_ListeningHistoryRetrieved() { sut = MakeSut(); var after = DateTime.UtcNow.AddDays(-1); var afterAsUnix = ((DateTimeOffset)after).ToUnixTimeMilliseconds(); var listeningHistory = sut.GetSpotifyRecentlyPlayed(spotifyAuthToken, afterAsUnix); listeningHistory.Result.Value.Should().NotBeNull(); listeningHistory.Result.Value.Should().NotBe(string.Empty); var listeningHistoryJson = JsonConvert.SerializeObject(listeningHistory.Result.Value); var actualListeningHistory = JsonConvert.DeserializeObject <CursorPaging <PlayHistoryItem> >(listeningHistoryJson); actualListeningHistory.Items.Should().HaveCount(1); actualListeningHistory.Items[0].Should().BeOfType <PlayHistoryItem>(); }