Commit e8899caf by Dima Bart

Update test shop data, update client test base with customer info.

parent 18c860b5
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
extern NSString * const BUYShopDomain_Placeholder; extern NSString * const BUYShopDomain_Placeholder;
extern NSString * const BUYAPIKey_Placeholder; extern NSString * const BUYAPIKey_Placeholder;
extern NSString * const BUYAppId_Placeholder; extern NSString * const BUYAppId_Placeholder;
extern NSString * const BUYChannelId_Placeholder;
extern NSString * const BUYFakeCustomerToken;
@interface BUYClientTestBase : XCTestCase @interface BUYClientTestBase : XCTestCase
...@@ -37,6 +39,8 @@ extern NSString * const BUYAppId_Placeholder; ...@@ -37,6 +39,8 @@ extern NSString * const BUYAppId_Placeholder;
@property (nonatomic, strong) NSString *apiKey; @property (nonatomic, strong) NSString *apiKey;
@property (nonatomic, strong) NSString *appId; @property (nonatomic, strong) NSString *appId;
@property (nonatomic, strong) NSString *merchantId; @property (nonatomic, strong) NSString *merchantId;
@property (nonatomic, strong) NSString *customerEmail;
@property (nonatomic, strong) NSString *customerPassword;
@property (nonatomic, strong) NSString *giftCardCode; @property (nonatomic, strong) NSString *giftCardCode;
@property (nonatomic, strong) NSString *giftCardCode2; @property (nonatomic, strong) NSString *giftCardCode2;
@property (nonatomic, strong) NSString *giftCardCode3; @property (nonatomic, strong) NSString *giftCardCode3;
...@@ -45,7 +49,11 @@ extern NSString * const BUYAppId_Placeholder; ...@@ -45,7 +49,11 @@ extern NSString * const BUYAppId_Placeholder;
@property (nonatomic, strong) NSString *giftCardCodeInvalid; @property (nonatomic, strong) NSString *giftCardCodeInvalid;
@property (nonatomic, strong) NSString *discountCodeValid; @property (nonatomic, strong) NSString *discountCodeValid;
@property (nonatomic, strong) NSString *discountCodeExpired; @property (nonatomic, strong) NSString *discountCodeExpired;
@property (nonatomic, strong) NSArray *productIds; @property (nonatomic, strong) NSArray *productIds;
@property (nonatomic, strong) NSNumber *variantUntrackedId;
@property (nonatomic, strong) NSNumber *variantInventory1Id;
@property (nonatomic, strong) NSNumber *variantSoldOutId;
@property (nonatomic, strong) BUYClient *client; @property (nonatomic, strong) BUYClient *client;
......
...@@ -53,6 +53,9 @@ NSString * const BUYAppId_Placeholder = @"app_id"; ...@@ -53,6 +53,9 @@ NSString * const BUYAppId_Placeholder = @"app_id";
self.appId = environment[kBUYTestAppId] ?: jsonConfig[kBUYTestAppId]; self.appId = environment[kBUYTestAppId] ?: jsonConfig[kBUYTestAppId];
self.merchantId = environment[kBUYTestMerchantId] ?: jsonConfig[kBUYTestMerchantId]; self.merchantId = environment[kBUYTestMerchantId] ?: jsonConfig[kBUYTestMerchantId];
self.customerEmail = environment[kBUYTestEmail] ?: jsonConfig[kBUYTestEmail];
self.customerPassword = environment[kBUYTestPassword] ?: jsonConfig[kBUYTestPassword];
NSDictionary *giftCards = jsonConfig[@"gift_cards"]; NSDictionary *giftCards = jsonConfig[@"gift_cards"];
self.giftCardCode = environment[kBUYTestGiftCardCode11] ?: giftCards[@"valid11"][@"code"]; self.giftCardCode = environment[kBUYTestGiftCardCode11] ?: giftCards[@"valid11"][@"code"];
...@@ -67,6 +70,10 @@ NSString * const BUYAppId_Placeholder = @"app_id"; ...@@ -67,6 +70,10 @@ NSString * const BUYAppId_Placeholder = @"app_id";
NSString *productIdsString = [environment[kBUYTestProductIdsCommaSeparated] stringByReplacingOccurrencesOfString:@" " withString:@""]; NSString *productIdsString = [environment[kBUYTestProductIdsCommaSeparated] stringByReplacingOccurrencesOfString:@" " withString:@""];
self.productIds = [productIdsString componentsSeparatedByString:@","]; self.productIds = [productIdsString componentsSeparatedByString:@","];
} else { } else {
self.variantUntrackedId = jsonConfig[@"variants"][@"variant_untracked_id"];
self.variantInventory1Id = jsonConfig[@"variants"][@"variant_inventory1_id"];
self.variantSoldOutId = jsonConfig[@"variants"][@"variant_soldout_id"];
self.productIds = jsonConfig[@"product_ids"]; self.productIds = jsonConfig[@"product_ids"];
} }
......
...@@ -32,6 +32,8 @@ ...@@ -32,6 +32,8 @@
#define kBUYTestAPIKey @"api_key" #define kBUYTestAPIKey @"api_key"
#define kBUYTestAppId @"app_id" #define kBUYTestAppId @"app_id"
#define kBUYTestMerchantId @"merchant_id" #define kBUYTestMerchantId @"merchant_id"
#define kBUYTestEmail @"customer_email"
#define kBUYTestPassword @"customer_password"
#define kBUYTestGiftCardCode11 @"gift_card_code_11" #define kBUYTestGiftCardCode11 @"gift_card_code_11"
#define kBUYTestGiftCardCode25 @"gift_card_code_25" #define kBUYTestGiftCardCode25 @"gift_card_code_25"
#define kBUYTestGiftCardCode50 @"gift_card_code_50" #define kBUYTestGiftCardCode50 @"gift_card_code_50"
......
...@@ -5,10 +5,17 @@ ...@@ -5,10 +5,17 @@
"channel_id": "", "channel_id": "",
"app_id": "", "app_id": "",
"merchant_id": "", "merchant_id": "",
"customer_email": "",
"customer_password": "",
"product_ids": [ "product_ids": [
"", "",
"" ""
], ],
"variants": {
"variant_untracked_id": "",
"variant_inventory1_id": "",
"variant_soldout_id": ""
},
"collection_id": "", "collection_id": "",
"gift_cards": { "gift_cards": {
"ValidGiftCard11": { "ValidGiftCard11": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment