Putting Success property back on ILastResponse

This commit is contained in:
Rikki Tooley 2015-04-05 00:57:42 +01:00
parent 82cfb8574f
commit ba826e9da5
4 changed files with 15 additions and 4 deletions

View File

@ -34,8 +34,6 @@ public void Initialise()
_scrobbler = new Scrobbler(_mockAuth.Object, httpClient);
}
[TestMethod]
public async Task CorrectResponseWithBadAuth()
{

View File

@ -7,6 +7,8 @@ namespace IF.Lastfm.Core.Api.Helpers
{
public interface ILastResponse
{
bool Success { get; }
LastResponseStatus Status { get; }
}

View File

@ -12,6 +12,7 @@ public override void WriteJson(JsonWriter writer, object value, JsonSerializer s
dynamic container = new
{
success = pageResponse.Success,
items = pageResponse.Content,
page = new
{

View File

@ -8,9 +8,19 @@ public class ScrobbleResponse : ILastResponse
{
public LastResponseStatus Status { get; internal set; }
public bool Cached
public bool Success
{
get { return Status == LastResponseStatus.Cached; }
get
{
switch (Status)
{
case LastResponseStatus.Successful:
case LastResponseStatus.Cached:
return true;
default:
return false;
}
}
}
public Exception Exception { get; internal set; }