public void should_succeed_if_return_all()
       {
           var pservice = new ProjectsService();
           var pcontroller = new ProjectsController(pservice);

           var res = pcontroller.GetProjects().Result;
           Assert.IsTrue(res.Count() > 0);
       }
       public void should_succeed_get_ById()
       {
           var pservice = new ProjectsService();
           var pcontroller = new ProjectsController(pservice);
         
           var res = pcontroller.GetProjects("5628f15462e7e026440c9482").Result;
           var contentResult = res as OkNegotiatedContentResult<Projects>;
           Assert.IsNotNull(contentResult);
           Assert.IsNotNull(contentResult.Content);

           Assert.AreEqual(contentResult.Content.Id, new ObjectId("5628f15462e7e026440c9482"));
       }
       public void should_succeed_if_projects_id_is_set_to_Mongodb_objectId()
        {
            var pservice = new ProjectsService();
            var pcontroller = new ProjectsController(pservice);
            pcontroller.Request = new HttpRequestMessage();
            pcontroller.Configuration = new HttpConfiguration();
           var p = new Projects
           {
               title= "eTimeSheet3",
               code="ET3"

           };
           var res = pcontroller.PostProjects(p);

           //Projects  project;
           //Assert.IsTrue(res.TryGetContentValue<Projects>(out project));
          // Assert.AreEqual(project.Id , ! null);
            
       }
       public void should_succeed_Update()
       {
           var pservice = new ProjectsService();
           var pcontroller = new ProjectsController(pservice);

           var res =pcontroller.GetProjects("5628f15462e7e026440c9482").Result;
           var contentResult = res as OkNegotiatedContentResult<Projects>;
           Assert.IsNotNull(contentResult);
           Assert.IsNotNull(contentResult.Content);
           Projects project = contentResult.Content;
           project.title = "TestProject";
           var res1 = pcontroller.PutProjects("5628f15462e7e026440c9482", project).Result;

           var contentResult1 = res as OkNegotiatedContentResult<Projects>;
           Assert.IsNotNull(contentResult1);
           Assert.IsNotNull(contentResult1.Content);
           Assert.AreEqual(contentResult1.Content.title, "TestProject");

          
            
       }
       public void should_succeed_Delete()
       {
           var pservice = new ProjectsService();
           var pcontroller = new ProjectsController(pservice);

           var res = pcontroller.DeleteProjects("5628f15462e7e026440c9482").Result;
           var contentResult = res as OkNegotiatedContentResult<Projects>;
           Assert.IsNotNull(contentResult);
           



       }