-
-
Notifications
You must be signed in to change notification settings - Fork 316
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joshua Harms
committed
Nov 25, 2015
1 parent
ff342e8
commit 10b2baa
Showing
11 changed files
with
193 additions
and
31 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" /></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" /></Playlist> |
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.Product.When_getting_a_list_of_products::should_have_the_correct_product_id" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_not_be_null" /><Add Test="ShopifySharp.Tests.Product.When_getting_one_product::should_not_be_null" /><Add Test="ShopifySharp.Tests.Product.When_deleting_a_product::should_not_throw_an_error" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_have_an_id" /><Add Test="ShopifySharp.Tests.Product.When_updating_a_product::should_have_the_new_title" /><Add Test="ShopifySharp.Tests.Product.When_updating_a_product::should_not_be_null" /><Add Test="ShopifySharp.Tests.Product.When_counting_products::should_be_greater_than_zero" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_have_a_title" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_have_one_item_in_the_list" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_retrieve_a_list_of_products_with_the_correct_id" /><Add Test="ShopifySharp.Tests.Product.When_deleting_a_product::should_delete_a_product" /><Add Test="ShopifySharp.Tests.Product.When_updating_a_product::should_update_a_product" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_retrieve_a_list_of_products" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_create_a_product" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_create_a_product_with_a_title" /><Add Test="ShopifySharp.Tests.Product.When_counting_products::should_retrieve_a_count_of_products" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_create_a_product_with_an_id" /><Add Test="ShopifySharp.Tests.Product.When_getting_one_product::should_retrieve_a_product" /><Add Test="ShopifySharp.Tests.Product.When_counting_products::should_count_products" /></Playlist> | ||
<Playlist Version="1.0"><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_have_the_correct_product_id" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_not_be_null" /><Add Test="ShopifySharp.Tests.Product.When_getting_one_product::should_not_be_null" /><Add Test="ShopifySharp.Tests.Product.When_deleting_a_product::should_not_throw_an_error" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_have_an_id" /><Add Test="ShopifySharp.Tests.Product.When_updating_a_product::should_have_the_new_title" /><Add Test="ShopifySharp.Tests.Product.When_updating_a_product::should_not_be_null" /><Add Test="ShopifySharp.Tests.Product.When_counting_products::should_be_greater_than_zero" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_have_a_title" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_have_one_item_in_the_list" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_retrieve_a_list_of_products_with_the_correct_id" /><Add Test="ShopifySharp.Tests.Product.When_deleting_a_product::should_delete_a_product" /><Add Test="ShopifySharp.Tests.Product.When_updating_a_product::should_update_a_product" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_retrieve_a_list_of_products" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_create_a_product" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_create_a_product_with_a_title" /><Add Test="ShopifySharp.Tests.Product.When_counting_products::should_retrieve_a_count_of_products" /><Add Test="ShopifySharp.Tests.Product.When_creating_a_product::should_create_a_product_with_an_id" /><Add Test="ShopifySharp.Tests.Product.When_getting_one_product::should_retrieve_a_product" /><Add Test="ShopifySharp.Tests.Product.When_counting_products::should_count_products" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_products::should_list_products" /><Add Test="ShopifySharp.Tests.Product.When_getting_a_list_of_filtered_products::should_list_products_with_specific_ids" /></Playlist> |
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
54 changes: 54 additions & 0 deletions
54
ShopifySharp.Tests/ShopifyProductService Tests/When_getting_a_list_of_products - Copy.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,54 @@ | ||
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.Product | ||
{ | ||
[Subject(typeof(ShopifyProductService))] | ||
public class When_getting_a_list_of_filtered_products | ||
{ | ||
Establish context = () => | ||
{ | ||
Service = new ShopifyProductService(Utils.MyShopifyUrl, Utils.AccessToken); | ||
|
||
for (var i = 0; i < 3; i++) | ||
{ | ||
var product = Service.CreateAsync(ProductCreation.CreateValidProducts(), new ShopifyProductCreateOptions() | ||
{ | ||
Published = false | ||
}).Await().AsTask.Result; | ||
|
||
ProductIds.Add(product.Id.Value); | ||
} | ||
}; | ||
|
||
Because of = () => | ||
{ | ||
Products = Service.ListAsync(new ShopifyProductFilterOptions() { Ids = ProductIds }).Await().AsTask.Result; | ||
}; | ||
|
||
It should_list_products_with_specific_ids = () => | ||
{ | ||
Products.Count().ShouldEqual(ProductIds.Count); | ||
Products.All(p => ProductIds.Contains(p.Id.Value)).ShouldBeTrue(); | ||
}; | ||
|
||
Cleanup after = () => | ||
{ | ||
foreach (var id in ProductIds) | ||
{ | ||
Service.DeleteAsync(id).Await(); | ||
} | ||
}; | ||
|
||
static ShopifyProductService Service; | ||
|
||
static List<long> ProductIds = new List<long>(); | ||
|
||
static IEnumerable<ShopifyProduct> Products; | ||
} | ||
} |
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
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