public void GetSupplier(string id)
        {
            var mock = new Mock <IController <Supplier> >();

            mock.Setup(q => q.Get(It.IsAny <string>())).Returns(CodeAndReason.Ok("Success"));
            CodeAndReason result = (CodeAndReason)mock.Object.Get(It.IsAny <string>());

            Assert.AreEqual(result.Code, HttpStatusCode.OK);
        }
예제 #2
0
        public void EditParentTask()
        {
            ParentTask item = new ParentTask()
            {
                Parent_Id   = 1,
                Parent_Task = "Parent Task 1"
            };

            var mock = new Mock <ITaskManagerController>();

            mock.Setup(q => q.EditParentTask(item)).Returns(CodeAndReason.Ok("Success"));
            CodeAndReason result = (CodeAndReason)mock.Object.EditParentTask(item);

            Assert.AreEqual(result.Code, HttpStatusCode.OK);
        }
        public void EditSupplier()
        {
            Supplier supplier = new Supplier()
            {
                SUPLADDR = "Dummy Address",
                SUPLNAME = "Dummy Name",
                SUPLNO   = "DM01"
            };

            var mock = new Mock <IController <Supplier> >();

            mock.Setup(q => q.Update(supplier)).Returns(CodeAndReason.Ok("Success"));
            CodeAndReason result = (CodeAndReason)mock.Object.Update(supplier);

            Assert.AreEqual(result.Code, HttpStatusCode.OK);
        }
예제 #4
0
        public void EditTask()
        {
            Task item = new Task()
            {
                Task_Id    = 2,
                Parent_Id  = 2,
                Task_Name  = "Task 1",
                Priority   = 2,
                Start_Date = "06/03/2019",
                End_Date   = "06/04/2019"
            };

            var mock = new Mock <ITaskManagerController>();

            mock.Setup(q => q.EditTask(item)).Returns(CodeAndReason.Ok("Success"));
            CodeAndReason result = (CodeAndReason)mock.Object.EditTask(item);

            Assert.AreEqual(result.Code, HttpStatusCode.OK);
        }