fix PocketAction conversion exception when no ID is given; fixes #20
This commit is contained in:
@@ -88,6 +88,21 @@ namespace PocketSharp.Tests
|
||||
}
|
||||
|
||||
|
||||
[Fact]
|
||||
public async Task AreMultipleAddActionsSent()
|
||||
{
|
||||
PocketItem item = await Setup();
|
||||
|
||||
bool success = await client.SendActions(new List<PocketAction>()
|
||||
{
|
||||
new PocketAction() { Action = "add", Uri = new Uri("http://msdn.microsoft.com/en-us/library/windows/apps/jj841126.aspx") },
|
||||
new PocketAction() { Action = "add", Uri = new Uri("http://pokiapp.com/changelog") }
|
||||
});
|
||||
|
||||
Assert.True(success);
|
||||
}
|
||||
|
||||
|
||||
private async Task<PocketItem> Setup()
|
||||
{
|
||||
PocketItem item = await client.Add(
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace PocketSharp.Models
|
||||
{ "action", Action }
|
||||
};
|
||||
|
||||
if (ID != "0" && !String.IsNullOrEmpty(ID.ToString()))
|
||||
if (!String.IsNullOrEmpty(ID) && ID != "0")
|
||||
parameters.Add("item_id", ID.ToString());
|
||||
if (Time != null)
|
||||
parameters.Add("time", Time != null ? Utilities.GetUnixTimestamp(Time).ToString() : null);
|
||||
|
||||
Reference in New Issue
Block a user