public products_fixture() { ProductCreateOptions = new StripeProductCreateOptions { Name = $"test-product-{ Guid.NewGuid() }" }; ProductTwoCreateOptions = new StripeProductCreateOptions { Name = $"test-product-{ Guid.NewGuid() }" }; ProductUpdateOptions = new StripeProductUpdateOptions { Name = $"test-product-{ Guid.NewGuid() }" }; var service = new StripeProductService(Cache.ApiKey); Product = service.Create(ProductCreateOptions); ProductTwo = service.Create(ProductTwoCreateOptions); ProductUpdated = service.Update(Product.Id, ProductUpdateOptions); ProductRetrieved = service.Get(Product.Id); ProductListOptions = new StripeProductListOptions { Url = Product.Url, Ids = new [] { Product.Id, ProductTwo.Id } }; ProductList = service.List(ProductListOptions).ToList(); }
public StripeProductServiceTest() { this.service = new StripeProductService(); this.createOptions = new StripeProductCreateOptions() { Attributes = new string[] { "attr1", "attr2", }, Name = "product name", PackageDimensions = new StripePackageDimensionOptions { Height = 100, Length = 100, Weight = 100, Width = 100, }, Type = "good", }; this.updateOptions = new StripeProductUpdateOptions() { Metadata = new Dictionary <string, string>() { { "key", "value" }, }, }; this.listOptions = new StripeProductListOptions() { Limit = 1, }; }
public products_fixture() { ProductCreateOptions = new StripeProductCreateOptions { Name = $"test-product-{ Guid.NewGuid() }", Type = "good", PackageDimensions = new StripePackageDimensionOptions { Height = 100, Length = 100, Weight = 100, Width = 100, }, Attributes = new string[] { "color", "size" }, }; ProductTwoCreateOptions = new StripeProductCreateOptions { Name = $"test-product-{ Guid.NewGuid() }", Type = "good", }; ProductUpdateOptions = new StripeProductUpdateOptions { Name = $"test-product-{ Guid.NewGuid() }", }; var service = new StripeProductService(Cache.ApiKey); Product = service.Create(ProductCreateOptions); ProductTwo = service.Create(ProductTwoCreateOptions); ProductUpdated = service.Update(Product.Id, ProductUpdateOptions); ProductRetrieved = service.Get(Product.Id); ProductListOptions = new StripeProductListOptions { Url = Product.Url, Ids = new [] { Product.Id, ProductTwo.Id } }; ProductList = service.List(ProductListOptions); service.Delete(Product.Id); service.Delete(ProductTwo.Id); }