return correct response status for "Send"

This commit is contained in:
2014-06-17 10:14:26 +02:00
parent 366908a070
commit 7cad855f9c
3 changed files with 30 additions and 3 deletions
+25
View File
@@ -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);
}
}
}
+2 -2
View File
@@ -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; }
}
}
+3 -1
View File
@@ -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;
}