Пример #1
0
        private void CreateItems()
        {
            var proxy  = new ItemProxy();
            var helper = new ItemHelper();

            var inventoryItem1 = helper.GetTestInventoryItem();
            var inventoryItem2 = helper.GetTestInventoryItem();

            //Create items.
            var result = proxy.InsertItem(inventoryItem1);

            _DeletedItemId = result.DataObject.InsertedItemId;

            result            = proxy.InsertItem(inventoryItem2);
            _NotDeletedItemId = result.DataObject.InsertedItemId;

            //Delete only first item.
            proxy.DeleteItem(_DeletedItemId);
        }
Пример #2
0
        public void ShouldDeleteComboItem()
        {
            var proxy     = new ItemProxy();
            var comboItem = _itemHelper.GetTestComboItem();

            var insertResponse = proxy.InsertItem(comboItem);

            Assert.IsTrue(insertResponse.IsSuccessfull);

            var deleteResponse = proxy.DeleteItem(insertResponse.DataObject.InsertedItemId);

            Assert.IsTrue(deleteResponse.IsSuccessfull);
            Assert.AreEqual(HttpStatusCode.OK, deleteResponse.StatusCode);

            var getResponse = proxy.GetItem(insertResponse.DataObject.InsertedItemId);

            Assert.IsFalse(getResponse.IsSuccessfull);
            Assert.AreEqual(HttpStatusCode.BadRequest, getResponse.StatusCode);
        }