private TaxRateDraft GetTaxRateDraft(string country = null, string state = null) { var taxRateDraft = new TaxRateDraft { Name = TestingUtility.RandomString(10), Country = country ?? "DE", State = state, Amount = TestingUtility.RandomDouble() }; return(taxRateDraft); }
public static TaxRateDraft GetTaxRateDraft(Address address) { var taxRateDraft = new TaxRateDraft { Country = address.Country, State = address.State, Name = RandomString(), Amount = RandomDecimal() }; return(taxRateDraft); }
public static TaxRateDraft GetTaxRateDraft(string name, string country, decimal amount, bool includeInPrice) { var taxRateDraft = new TaxRateDraft { Amount = amount, Country = country, Name = name, IncludedInPrice = includeInPrice }; return(taxRateDraft); }
/// <summary> /// Creates a test tax category draft. /// </summary> /// <returns>TaxCategoryDraft</returns> public static TaxCategoryDraft GetTestTaxCategoryDraft(Project.Project project) { List <TaxRateDraft> taxRateDrafts = new List <TaxRateDraft>(); foreach (string country in project.Countries) { string taxRateName = string.Concat("Rate ", country); TaxRateDraft taxRateDraft = new TaxRateDraft(taxRateName, true, country); taxRateDraft.Amount = ((decimal)Helper.GetRandomNumber(1, 20)) / 100; taxRateDrafts.Add(taxRateDraft); } string name = string.Concat("Test Tax Category ", Helper.GetRandomString(10)); TaxCategoryDraft taxCategoryDraft = new TaxCategoryDraft(name, taxRateDrafts); taxCategoryDraft.Description = "Created by commercetools.NET"; return(taxCategoryDraft); }
/// <summary> /// Constructor. /// </summary> /// <param name="taxRate">TaxRateDraft</param> public AddTaxRateAction(TaxRateDraft taxRate) { this.Action = "addTaxRate"; this.TaxRate = taxRate; }
public static TaxCategoryDraft DefaultTaxCategoryDraftWithTaxRate(TaxCategoryDraft taxCategoryDraft, TaxRateDraft taxRateDraft) { var random = TestingUtility.RandomInt(); taxCategoryDraft.Name = $"TaxCategory_{random}"; taxCategoryDraft.Key = $"key_{random}"; taxCategoryDraft.Rates = new List <TaxRateDraft> { taxRateDraft }; return(taxCategoryDraft); }
/// <summary> /// Constructor. /// </summary> /// <param name="taxRateId">TaxRateId</param> /// <param name="taxRate">TaxRateDraft</param> public ReplaceTaxRateAction(string taxRateId, TaxRateDraft taxRate) { this.Action = "replaceTaxRate"; this.TaxRateId = taxRateId; this.TaxRate = taxRate; }