public void SubscriptionUpdateArguments_GetAllKeys() { // Arrange _args.ApplicationFeePercent = 1; _args.Metadata = Data.Metadata; _args.Quantity = 1; _args.TaxPercent = 8.2m; _args.TrialEnd = DateTime.UtcNow; // Act var keyValuePairs = StripeClient.GetModelKeyValuePairs(_args).ToList(); // Assert keyValuePairs.Should().HaveCount(9) .And.Contain(x => x.Key == "application_fee_percent") .And.Contain(x => x.Key == "coupon") .And.Contain(x => x.Key == "metadata[key1]") .And.Contain(x => x.Key == "metadata[key2]") .And.Contain(x => x.Key == "plan") .And.Contain(x => x.Key == "quantity") .And.Contain(x => x.Key == "source") .And.Contain(x => x.Key == "tax_percent") .And.Contain(x => x.Key == "trial_end"); }
public void BalanceTransactionListFilter_GetAllKeys() { // Arrange _filter.Limit = 10; _filter.AvailableOnDateTime = null; _filter.AvailableOnFilter = Data.DateFilter; // Act var keyValuePairs = StripeClient.GetModelKeyValuePairs(_filter).ToList(); // Assert keyValuePairs.Should().HaveCount(11, string.Join("\r\n", keyValuePairs.Select(x => x.Key + " : " + x.Value))) .And.Contain(x => x.Key == "currency") .And.Contain(x => x.Key == "source") .And.Contain(x => x.Key == "transfer") .And.Contain(x => x.Key == "type") .And.Contain(x => x.Key == "available_on[gt]") .And.Contain(x => x.Key == "available_on[gte]") .And.Contain(x => x.Key == "available_on[lt]") .And.Contain(x => x.Key == "available_on[lte]") .And.Contain(x => x.Key == "ending_before") .And.Contain(x => x.Key == "starting_after"); }
public void AccountUpdateArguments_LegalEntityWhenSet() { // Arrange _args.LegalEntity = GenFu.GenFu.New <LegalEntityArguments>(); _args.LegalEntity.Dob = new DateOfBirthArguments { Day = 21, Month = 10, Year = 1978 }; _args.LegalEntity.PersonalAddress = GenFu.GenFu.New <AddressArguments>(); _args.LegalEntity.PersonalAddressKana = GenFu.GenFu.New <AddressArguments>(); _args.LegalEntity.PersonalAddressKanji = GenFu.GenFu.New <AddressArguments>(); _args.LegalEntity.AdditionalOwners = new List <AdditionalOwnerArguments> { GenFu.GenFu.New <AdditionalOwnerArguments>(), GenFu.GenFu.New <AdditionalOwnerArguments>(), GenFu.GenFu.New <AdditionalOwnerArguments>() }; // Act var keyValuePairs = StripeClient.GetModelKeyValuePairs(_args).ToList(); // Assert keyValuePairs.Should().Contain(x => x.Key == "legal_entity[additional_owners][0][first_name]") .And.Contain(x => x.Key == "legal_entity[additional_owners][1][first_name]") .And.Contain(x => x.Key == "legal_entity[additional_owners][2][first_name]") .And.Contain(x => x.Key == "legal_entity[business_name]") .And.Contain(x => x.Key == "legal_entity[business_name_kana]") .And.Contain(x => x.Key == "legal_entity[business_name_kanji]") .And.Contain(x => x.Key == "legal_entity[business_tax_id]") .And.Contain(x => x.Key == "legal_entity[business_vat_id]") .And.Contain(x => x.Key == "legal_entity[dob][day]") .And.Contain(x => x.Key == "legal_entity[dob][month]") .And.Contain(x => x.Key == "legal_entity[dob][year]") .And.Contain(x => x.Key == "legal_entity[first_name]") .And.Contain(x => x.Key == "legal_entity[first_name_kana]") .And.Contain(x => x.Key == "legal_entity[first_name_kanji]") .And.Contain(x => x.Key == "legal_entity[gender]") .And.Contain(x => x.Key == "legal_entity[last_name]") .And.Contain(x => x.Key == "legal_entity[last_name_kana]") .And.Contain(x => x.Key == "legal_entity[last_name_kanji]") .And.Contain(x => x.Key == "legal_entity[maiden_name]") .And.Contain(x => x.Key == "legal_entity[personal_address][city]") .And.Contain(x => x.Key == "legal_entity[personal_address][country]") .And.Contain(x => x.Key == "legal_entity[personal_address][line1]") .And.Contain(x => x.Key == "legal_entity[personal_address][line2]") .And.Contain(x => x.Key == "legal_entity[personal_address][postal_code]") .And.Contain(x => x.Key == "legal_entity[personal_address][state]") .And.Contain(x => x.Key == "legal_entity[personal_address][town]") .And.Contain(x => x.Key == "legal_entity[personal_address_kana][city]") .And.Contain(x => x.Key == "legal_entity[personal_address_kana][country]") .And.Contain(x => x.Key == "legal_entity[personal_address_kana][line1]") .And.Contain(x => x.Key == "legal_entity[personal_address_kana][line2]") .And.Contain(x => x.Key == "legal_entity[personal_address_kana][postal_code]") .And.Contain(x => x.Key == "legal_entity[personal_address_kana][state]") .And.Contain(x => x.Key == "legal_entity[personal_address_kana][town]") .And.Contain(x => x.Key == "legal_entity[personal_address_kanji][city]") .And.Contain(x => x.Key == "legal_entity[personal_address_kanji][country]") .And.Contain(x => x.Key == "legal_entity[personal_address_kanji][line1]") .And.Contain(x => x.Key == "legal_entity[personal_address_kanji][line2]") .And.Contain(x => x.Key == "legal_entity[personal_address_kanji][postal_code]") .And.Contain(x => x.Key == "legal_entity[personal_address_kanji][state]") .And.Contain(x => x.Key == "legal_entity[personal_address_kanji][town]") .And.Contain(x => x.Key == "legal_entity[personal_id_number]") .And.Contain(x => x.Key == "legal_entity[phone_number]") .And.Contain(x => x.Key == "legal_entity[ssn_last_4]") .And.Contain(x => x.Key == "legal_entity[type]"); }