public void Delete() { CrudProxy proxy = new InventoryItemProxy(); InventoryItemDto dto1 = this.GetInventoryItem(); proxy.Insert(dto1); proxy.DeleteByUid(dto1.Uid); try { proxy.GetByUid(dto1.Uid); } catch (RestException ex) { Assert.AreEqual("RecordNotFoundException", ex.Type); } }
public void UpdateDeleted() { CrudProxy proxy = new InventoryItemProxy(); InventoryItemDto dto1 = this.GetInventoryItem(); proxy.Insert(dto1); proxy.DeleteByUid(dto1.Uid); dto1.Description = "Try updating deleted item"; try { proxy.Update(dto1); throw new Exception("Expected exception not thrown."); } catch (RestException rex) { if (!rex.Message.Contains("Unable to find inventory item uid")) { throw new Exception("Possibly incorrect error thrown."); } } }