Skip to content

Commit 80dd574

Browse files
committed
Fixed Tests with adding ResponseInfo.Empty
1 parent 15d8fd8 commit 80dd574

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

SpotifyAPI.Tests/TestClass.cs

+4-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ public void ShouldGetPrivateProfile_WithoutAuth()
5050
public void ShouldGetPrivateProfile_WithAuth()
5151
{
5252
PrivateProfile profile = GetFixture<PrivateProfile>("private-user.json");
53-
_mock.Setup(client => client.DownloadJson<PrivateProfile>(It.IsAny<string>())).Returns(new Tuple<ResponseInfo, PrivateProfile>(null, profile));
53+
_mock.Setup(client => client.DownloadJson<PrivateProfile>(It.IsAny<string>()))
54+
.Returns(new Tuple<ResponseInfo, PrivateProfile>(ResponseInfo.Empty, profile));
5455

5556
_spotify.UseAuth = true;
5657
Assert.AreEqual(profile, _spotify.GetPrivateProfile());
@@ -61,7 +62,8 @@ public void ShouldGetPrivateProfile_WithAuth()
6162
public void ShouldGetPublicProfile()
6263
{
6364
PublicProfile profile = GetFixture<PublicProfile>("public-user.json");
64-
_mock.Setup(client => client.DownloadJson<PublicProfile>(It.IsAny<string>())).Returns(new Tuple<ResponseInfo, PublicProfile>(null, profile));
65+
_mock.Setup(client => client.DownloadJson<PublicProfile>(It.IsAny<string>()))
66+
.Returns(new Tuple<ResponseInfo, PublicProfile>(ResponseInfo.Empty, profile));
6567

6668
Assert.AreEqual(profile, _spotify.GetPublicProfile("wizzler"));
6769
_mock.Verify(client => client.DownloadJson<PublicProfile>(It.Is<string>(str => ContainsValues(str, "/users/wizzler"))), Times.Exactly(1));

SpotifyAPI/Web/Models/ResponseInfo.cs

+2
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ namespace SpotifyAPI.Web.Models
55
public class ResponseInfo
66
{
77
public WebHeaderCollection Headers { get; set; }
8+
9+
public static readonly ResponseInfo Empty = new ResponseInfo();
810
}
911
}

0 commit comments

Comments
 (0)