mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-17 07:13:09 +01:00
Putting Success property back on ILastResponse
This commit is contained in:
parent
82cfb8574f
commit
ba826e9da5
@ -34,8 +34,6 @@ public void Initialise()
|
||||
_scrobbler = new Scrobbler(_mockAuth.Object, httpClient);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[TestMethod]
|
||||
public async Task CorrectResponseWithBadAuth()
|
||||
{
|
||||
|
@ -7,6 +7,8 @@ namespace IF.Lastfm.Core.Api.Helpers
|
||||
{
|
||||
public interface ILastResponse
|
||||
{
|
||||
bool Success { get; }
|
||||
|
||||
LastResponseStatus Status { get; }
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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; }
|
||||
|
Loading…
Reference in New Issue
Block a user