예제 #1
0
        public void TestUpdatetItemCode_Invalid_Guid()
        {
            var testUpdatetItemCode = new ItemCodesController();

            Mocker.MockContextHeader(testUpdatetItemCode);
            string     ItemName   = "Server";
            string     ItemCode   = "IT0208";
            string     ItemCodeID = "223333";
            string     CategoryID = "f1ced345-32aa-41f2-9045-90c02f2c209a";
            JsonResult result     = (JsonResult)testUpdatetItemCode.UpdateItemCode(ItemCode, ItemCodeID, ItemName, CategoryID);

            Console.WriteLine(result.Data);
            Assert.IsTrue((result.Data + "").Contains("Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."));
        }
예제 #2
0
        public void TestUpdatetItemCode_Successfully()
        {
            var testUpdatetItemCode = new ItemCodesController();

            Mocker.MockContextHeader(testUpdatetItemCode);
            string     ItemName   = "Server";
            string     ItemCode   = "DW0900";
            string     ItemCodeID = "210F8DF4-34F9-4BA4-934A-A294972E447C";
            string     CategoryID = "f1ced345-32aa-41f2-9045-90c02f2c209a";
            JsonResult result     = (JsonResult)testUpdatetItemCode.UpdateItemCode(ItemCode, ItemCodeID, ItemName, CategoryID);

            Console.WriteLine(result.Data);
            Assert.IsTrue((result.Data + "").Contains("Item updated successfully."));
        }