-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
VT-6136 Shopify: Shopify quantity not matching quantity in SV (#34)
* VT-6136 : ignore case for enum * 1.9.0.0 * VT-6136 : updated to TestCase * VT-6136 : added more tests for Blank
- Loading branch information
1 parent
bbd3e27
commit 07b05bb
Showing
4 changed files
with
45 additions
and
2 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
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
42 changes: 42 additions & 0 deletions
42
src/ShopifyAccessTests/ShopifyAccessTests/Products/Models/ShopifyProductVariantTests.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,42 @@ | ||
using FluentAssertions; | ||
using NUnit.Framework; | ||
using ServiceStack.Text; | ||
using ShopifyAccess.Models.ProductVariant; | ||
|
||
namespace ShopifyAccessTests.Products.Models | ||
{ | ||
[ TestFixture ] | ||
public class ShopifyProductVariantTests | ||
{ | ||
[ TestCase( "" ) ] | ||
[ TestCase( null ) ] | ||
[ TestCase( "Blank" ) ] | ||
[ TestCase( "blank" ) ] | ||
[ TestCase( "strange_status" ) ] | ||
public void Deserialize_ReturnsBlankInventoryManagement( string rawInventoryManagement ) | ||
{ | ||
// Arrange | ||
var json = "{\"id\":1,\"inventory_management\":\"" + rawInventoryManagement + "\",\"inventory_item_id\":0,\"weight\":0,\"price\":0,\"updated_at\":\"\\/Date(-62135596800000-0000)\\/\"}"; | ||
|
||
// Act | ||
var shopifyProductVariant = JsonSerializer.DeserializeFromString< ShopifyProductVariant >( json ); | ||
|
||
// Assert | ||
shopifyProductVariant.InventoryManagement.Should().Be( InventoryManagementEnum.Blank ); | ||
} | ||
|
||
[ TestCase( "Shopify" ) ] | ||
[ TestCase( "shopify" ) ] | ||
public void Deserialize_ReturnsShopifyInventoryManagement( string rawInventoryManagement ) | ||
{ | ||
// Arrange | ||
var json = "{\"id\":1,\"inventory_management\":\"" + rawInventoryManagement + "\",\"inventory_item_id\":0,\"weight\":0,\"price\":0,\"updated_at\":\"\\/Date(-62135596800000-0000)\\/\"}"; | ||
|
||
// Act | ||
var shopifyProductVariant = JsonSerializer.DeserializeFromString< ShopifyProductVariant >( json ); | ||
|
||
// Assert | ||
shopifyProductVariant.InventoryManagement.Should().Be( InventoryManagementEnum.Shopify ); | ||
} | ||
} | ||
} |
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