示例#1
0
        public void GetToDoTest()
        {
            var            container         = ContainerRegister.getContainer();
            IBusinessLayer IBusinessLayerobj = container.Resolve <IBusinessLayer>();
            var            OrderObj          = new MyToDoListController(IBusinessLayerobj)
            {
                Request       = new System.Net.Http.HttpRequestMessage(),
                Configuration = new System.Web.Http.HttpConfiguration()
            };

            //MyToDoListController myToDoList = new MyToDoListController(IBusinessLayerobj);
            HttpResponseMessage toDos = OrderObj.Get("User1");

            Assert.AreEqual(toDos.StatusCode, HttpStatusCode.OK);
        }
示例#2
0
        public void PostToDo()
        {
            var            container         = ContainerRegister.getContainer();
            IBusinessLayer IBusinessLayerobj = container.Resolve <IBusinessLayer>();

            TaskToDo task = new TaskToDo()
            {
                UserName = "******",
                Note     = "Hi"
            };
            var OrderObj = new MyToDoListController(IBusinessLayerobj)
            {
                Request       = new System.Net.Http.HttpRequestMessage(),
                Configuration = new System.Web.Http.HttpConfiguration()
            };

            //MyToDoListController myToDoList = new MyToDoListController(IBusinessLayerobj);
            HttpResponseMessage toDos = OrderObj.Post(task);

            Assert.AreEqual((toDos.Content as ObjectContent).Value, true);
        }
        public void PostToDo()
        {
            var            container         = ContainerRegister.getContainer();
            IBusinessLayer IBusinessLayerobj = container.Resolve <IBusinessLayer>();

            User task = new User()
            {
                UserName = "******",
                Password = "******"
            };
            var OrderObj = new LoginController(IBusinessLayerobj)
            {
                Request       = new System.Net.Http.HttpRequestMessage(),
                Configuration = new System.Web.Http.HttpConfiguration()
            };

            //MyToDoListController myToDoList = new MyToDoListController(IBusinessLayerobj);
            HttpResponseMessage toDos = OrderObj.Post(task);

            Assert.AreEqual(toDos.StatusCode, System.Net.HttpStatusCode.OK);
        }