From 80dd574c4b5d0441d125629ad3524987dbc3f482 Mon Sep 17 00:00:00 2001 From: "Johnny @PC" Date: Thu, 7 Jul 2016 21:38:07 +0200 Subject: [PATCH] Fixed Tests with adding ResponseInfo.Empty --- SpotifyAPI.Tests/TestClass.cs | 6 ++++-- SpotifyAPI/Web/Models/ResponseInfo.cs | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/SpotifyAPI.Tests/TestClass.cs b/SpotifyAPI.Tests/TestClass.cs index 04151142..91a124f2 100644 --- a/SpotifyAPI.Tests/TestClass.cs +++ b/SpotifyAPI.Tests/TestClass.cs @@ -50,7 +50,8 @@ namespace SpotifyAPI.Tests public void ShouldGetPrivateProfile_WithAuth() { PrivateProfile profile = GetFixture("private-user.json"); - _mock.Setup(client => client.DownloadJson(It.IsAny())).Returns(new Tuple(null, profile)); + _mock.Setup(client => client.DownloadJson(It.IsAny())) + .Returns(new Tuple(ResponseInfo.Empty, profile)); _spotify.UseAuth = true; Assert.AreEqual(profile, _spotify.GetPrivateProfile()); @@ -61,7 +62,8 @@ namespace SpotifyAPI.Tests public void ShouldGetPublicProfile() { PublicProfile profile = GetFixture("public-user.json"); - _mock.Setup(client => client.DownloadJson(It.IsAny())).Returns(new Tuple(null, profile)); + _mock.Setup(client => client.DownloadJson(It.IsAny())) + .Returns(new Tuple(ResponseInfo.Empty, profile)); Assert.AreEqual(profile, _spotify.GetPublicProfile("wizzler")); _mock.Verify(client => client.DownloadJson(It.Is(str => ContainsValues(str, "/users/wizzler"))), Times.Exactly(1)); diff --git a/SpotifyAPI/Web/Models/ResponseInfo.cs b/SpotifyAPI/Web/Models/ResponseInfo.cs index b1fc96ea..ffc94777 100644 --- a/SpotifyAPI/Web/Models/ResponseInfo.cs +++ b/SpotifyAPI/Web/Models/ResponseInfo.cs @@ -5,5 +5,7 @@ namespace SpotifyAPI.Web.Models public class ResponseInfo { public WebHeaderCollection Headers { get; set; } + + public static readonly ResponseInfo Empty = new ResponseInfo(); } } \ No newline at end of file