Fixed Tests with adding ResponseInfo.Empty

This commit is contained in:
Johnny @PC 2016-07-07 21:38:07 +02:00
parent 15d8fd87e2
commit 80dd574c4b
2 changed files with 6 additions and 2 deletions

View File

@ -50,7 +50,8 @@ namespace SpotifyAPI.Tests
public void ShouldGetPrivateProfile_WithAuth()
{
PrivateProfile profile = GetFixture<PrivateProfile>("private-user.json");
_mock.Setup(client => client.DownloadJson<PrivateProfile>(It.IsAny<string>())).Returns(new Tuple<ResponseInfo, PrivateProfile>(null, profile));
_mock.Setup(client => client.DownloadJson<PrivateProfile>(It.IsAny<string>()))
.Returns(new Tuple<ResponseInfo, PrivateProfile>(ResponseInfo.Empty, profile));
_spotify.UseAuth = true;
Assert.AreEqual(profile, _spotify.GetPrivateProfile());
@ -61,7 +62,8 @@ namespace SpotifyAPI.Tests
public void ShouldGetPublicProfile()
{
PublicProfile profile = GetFixture<PublicProfile>("public-user.json");
_mock.Setup(client => client.DownloadJson<PublicProfile>(It.IsAny<string>())).Returns(new Tuple<ResponseInfo, PublicProfile>(null, profile));
_mock.Setup(client => client.DownloadJson<PublicProfile>(It.IsAny<string>()))
.Returns(new Tuple<ResponseInfo, PublicProfile>(ResponseInfo.Empty, profile));
Assert.AreEqual(profile, _spotify.GetPublicProfile("wizzler"));
_mock.Verify(client => client.DownloadJson<PublicProfile>(It.Is<string>(str => ContainsValues(str, "/users/wizzler"))), Times.Exactly(1));

View File

@ -5,5 +5,7 @@ namespace SpotifyAPI.Web.Models
public class ResponseInfo
{
public WebHeaderCollection Headers { get; set; }
public static readonly ResponseInfo Empty = new ResponseInfo();
}
}