예제 #1
0
        public void TestAddtItemCode_Successfull()
        {
            var testAddtItemCode = new ItemCodesController();

            Mocker.MockContextHeader(testAddtItemCode);
            string     itemName   = "Server";
            string     itemCode   = "IT0300";
            string     CategoryID = "f1ced345-32aa-41f2-9045-90c02f2c209a";
            JsonResult result     = (JsonResult)testAddtItemCode.Add(itemName, itemCode, CategoryID);

            Console.WriteLine(result.Data);
            Assert.IsTrue((result.Data + "").Contains("All item codes"));
        }
예제 #2
0
        public void TestAddtItemCode_Null_ItemCode()
        {
            var testAddtItemCode = new ItemCodesController();

            Mocker.MockContextHeader(testAddtItemCode);
            string     itemName   = "Server";
            string     itemCode   = "";
            string     CategoryID = "";
            JsonResult result     = (JsonResult)testAddtItemCode.Add(itemName, itemCode, CategoryID);

            Console.WriteLine(result.Data);
            Assert.IsTrue((result.Data + "").Contains("ItemCode is null"));
        }