return correct response status for "Send"
This commit is contained in:
@@ -65,5 +65,30 @@ namespace PocketSharp.Tests
|
||||
|
||||
itemsToDelete.Add(item.ID);
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public async Task ItemViaActionsIsAdded()
|
||||
{
|
||||
var uri = new Uri("http://frontendplay.com/story/4015/string-indexer-for-text-resources-in-nancy");
|
||||
|
||||
PocketAction action = new PocketAction()
|
||||
{
|
||||
Uri = uri,
|
||||
Action = "add",
|
||||
Time = DateTime.Now
|
||||
};
|
||||
|
||||
bool success = await client.SendAction(action);
|
||||
|
||||
Assert.True(success);
|
||||
|
||||
IEnumerable<PocketItem> items = await client.Search("String Indexer");
|
||||
|
||||
Assert.NotNull(items);
|
||||
Assert.True(items.Count() > 0);
|
||||
|
||||
itemsToDelete.Add(items.First().ID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace PocketSharp.Models
|
||||
/// <value>
|
||||
/// The action results.
|
||||
/// </value>
|
||||
//[JsonProperty("action_results")]
|
||||
//public bool[] ActionResults { get; set; }
|
||||
[JsonProperty("action_results")]
|
||||
public bool[] ActionResults { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -316,7 +316,9 @@ namespace PocketSharp
|
||||
"actions", JsonConvert.SerializeObject(actionParameters.Select(action => action.Convert()))
|
||||
}};
|
||||
|
||||
return (await Request<Modify>("send", cancellationToken, parameters)).Status;
|
||||
Modify result = (await Request<Modify>("send", cancellationToken, parameters));
|
||||
|
||||
return result.ActionResults != null ? !result.ActionResults.Contains(false) : result.Status;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user