-
-
Notifications
You must be signed in to change notification settings - Fork 313
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test for #19, bumped version to 1.11.4.
- Loading branch information
1 parent
4d76673
commit 036fde0
Showing
6 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<Playlist Version="1.0"><Add Test="ShopifySharp.Tests.When_getting_an_order::should_get_an_order" /><Add Test="ShopifySharp.Tests.When_updating_an_order::should_update_an_order" /><Add Test="ShopifySharp.Tests.When_opening_an_order::should_open_an_order" /><Add Test="ShopifySharp.Tests.When_closing_an_order::should_close_an_order" /><Add Test="ShopifySharp.Tests.When_listing_orders_with_options::should_only_list_2_orders" /><Add Test="ShopifySharp.Tests.When_deleting_an_order::should_delete_an_order" /><Add Test="ShopifySharp.Tests.When_counting_orders::should_retrieve_a_count_of_orders" /><Add Test="ShopifySharp.Tests.When_listing_orders::should_list_orders" /><Add Test="ShopifySharp.Tests.When_creating_an_order::should_create_an_order" /><Add Test="ShopifySharp.Tests.When_listing_orders_with_options::should_list_orders_with_a_specific_id" /><Add Test="ShopifySharp.Tests.When_listing_orders_with_options::should_list_orders_with_specific_ids" /></Playlist> | ||
<Playlist Version="1.0"><Add Test="ShopifySharp.Tests.When_getting_an_order::should_get_an_order" /><Add Test="ShopifySharp.Tests.When_updating_an_order::should_update_an_order" /><Add Test="ShopifySharp.Tests.When_opening_an_order::should_open_an_order" /><Add Test="ShopifySharp.Tests.When_closing_an_order::should_close_an_order" /><Add Test="ShopifySharp.Tests.When_listing_orders_with_options::should_only_list_2_orders" /><Add Test="ShopifySharp.Tests.When_deleting_an_order::should_delete_an_order" /><Add Test="ShopifySharp.Tests.When_counting_orders::should_retrieve_a_count_of_orders" /><Add Test="ShopifySharp.Tests.When_listing_orders::should_list_orders" /><Add Test="ShopifySharp.Tests.When_creating_an_order::should_create_an_order" /><Add Test="ShopifySharp.Tests.When_listing_orders_with_options::should_list_orders_with_a_specific_id" /><Add Test="ShopifySharp.Tests.When_listing_orders_with_options::should_list_orders_with_specific_ids" /><Add Test="ShopifySharp.Tests.When_listing_orders_with_since_id::should_list_orders_greater_than_since_id" /></Playlist> |
62 changes: 62 additions & 0 deletions
62
ShopifySharp.Tests/ShopifyOrderService Tests/When_listing_orders_with_since_id.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
using Machine.Specifications; | ||
using ShopifySharp.Tests.Test_Data; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace ShopifySharp.Tests | ||
{ | ||
[Subject(typeof(ShopifyOrderService))] | ||
public class When_listing_orders_with_since_id | ||
{ | ||
Establish context = () => | ||
{ | ||
Service = new ShopifyOrderService(Utils.MyShopifyUrl, Utils.AccessToken); | ||
for (int i = 0; i < 5; i++) | ||
{ | ||
var order = Service.CreateAsync(OrderCreation.CreateValidOrder()).Await().AsTask.Result; | ||
CreatedIds.Add(order.Id.Value); | ||
} | ||
SinceId = CreatedIds[2]; | ||
Options = new ShopifyOrderFilterOptions() | ||
{ | ||
SinceId = SinceId | ||
}; | ||
}; | ||
|
||
Because of = () => | ||
{ | ||
Result = Service.ListAsync(Options).Await().AsTask.Result; | ||
}; | ||
|
||
It should_list_orders_greater_than_since_id = () => | ||
{ | ||
Result.ShouldNotBeNull(); | ||
Result.All(order => order.Id > SinceId).ShouldBeTrue(); | ||
}; | ||
|
||
Cleanup after = () => | ||
{ | ||
foreach (var id in CreatedIds) | ||
{ | ||
Service.DeleteAsync(id).Await(); | ||
} | ||
}; | ||
|
||
static long SinceId; | ||
|
||
static ShopifyOrderService Service; | ||
|
||
static IEnumerable<ShopifyOrder> Result; | ||
|
||
static ShopifyOrderFilterOptions Options; | ||
|
||
static List<long> CreatedIds = new List<long>(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters