Ejemplo n.º 1
0
        public void Store_EditItem_JustNegativeAmount_ByOpener_ShouldFail()
        {
            LoginSessionSuccess(REGISTERED_SESSION_ID, FIRST_OPENER_USERNAME);

            Item item = AddOneItemTo_FIRST_STORE_LegalUserForOp(REGISTERED_SESSION_ID);

            string jsonAnswer = EditItemError(REGISTERED_SESSION_ID, FIRST_STORE_ID, item.Id, amount: -5, rank: null, price: null, name: null, categories: null, keyWords: null);
            InvalidOperationOnItemException e = JsonConvert.DeserializeObject <InvalidOperationOnItemException>(jsonAnswer);

            Assert.AreEqual("EditItem: item must have an amount >= 0", e.Message);
        }
Ejemplo n.º 2
0
        public void Store_EditItem_NameAlreadyExist_ByOpener_ShouldFail()
        {
            LoginSessionSuccess(REGISTERED_SESSION_ID, FIRST_OPENER_USERNAME);

            Item[] items = AddTwoItemsTo_FIRST_STORE_LegalUserForOp(REGISTERED_SESSION_ID);


            string jsonAnswer = EditItemError(REGISTERED_SESSION_ID, FIRST_STORE_ID, items[0].Id, amount: null, rank: null, price: null, name: "newitem two", categories: null, keyWords: null);
            InvalidOperationOnItemException e = JsonConvert.DeserializeObject <InvalidOperationOnItemException>(jsonAnswer);

            Assert.AreEqual("Item with name " + "newitem two" + " already exists", e.Message);
        }