예제 #1
0
        public void CanCreateUpdateAndDeleteTriggers()
        {
            var brand = new Brand()
            {
                Name = "Test Brand",
                Active = true,
                Subdomain = string.Format("test-{0}", Guid.NewGuid())
            };

            var res = api.Brands.CreateBrand(brand);

            Assert.Greater(res.Brand.Id, 0);

            res.Brand.Name = "Test Brand Updated";
            var update        = api.Brands.UpdateBrand(res.Brand);
            Assert.AreEqual(update.Brand.Name, res.Brand.Name);

            Assert.True(api.Brands.DeleteBrand(res.Brand.Id.Value));
        }
예제 #2
0
 public async Task<IndividualBrandResponse> UpdateBrandAsync(Brand brand)
 {
     var body = new { brand };
     return await GenericPutAsync<IndividualBrandResponse>(string.Format("brands/{0}.json", brand.Id), body);
 }
예제 #3
0
 public IndividualBrandResponse UpdateBrand(Brand brand)
 {
     var body = new { brand };
     return GenericPut<IndividualBrandResponse>(string.Format("brands/{0}.json", brand.Id), body);
 }
예제 #4
0
 public async Task<IndividualBrandResponse> CreateBrandAsync(Brand brand)
 {
     var body = new { brand };
     return await GenericPostAsync<IndividualBrandResponse>("brands.json", body);
 }
예제 #5
0
 public IndividualBrandResponse CreateBrand(Brand brand)
 {
     var body = new { brand };
     return GenericPost<IndividualBrandResponse>("brands.json", body);
 }