public void Constructor_WithEmptyDetails_ThrowException()
 {
     sut = new BookmarkController(null);
 }
        public void Setup()
        {
            user = new Mock<IPrincipal>();
            identity = new Mock<IIdentity>();
            user.Setup(x => x.Identity).Returns(identity.Object);
            identity.Setup(x => x.Name).Returns("Tom");
            Thread.CurrentPrincipal = user.Object;

            uowMock = new Mock<IReadgressUow>();
            bookmarkRepositoryMock = new Mock<IBookmarkRepository>();

            HttpConfiguration config = new HttpConfiguration();
            HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "http://localhost/api/bookmark");
            IHttpRoute route = config.Routes.MapHttpRoute("DefaultApi", "api/{controller}/{id}");
            HttpRouteData routeData = new HttpRouteData(route, new HttpRouteValueDictionary { { "controller", "bookmark" } });

            sut = new BookmarkController(uowMock.Object);
            sut.ControllerContext = new HttpControllerContext(config, routeData, request);
            sut.Request = request;
            sut.Request.Properties[HttpPropertyKeys.HttpConfigurationKey] = config;
            sut.Request.Properties.Add(HttpPropertyKeys.HttpRouteDataKey, routeData);

            readerTest = new Reader
            {
                Id = 1,
                FirstName = "Tom",
                LastName = "Jerry",
                Email = "*****@*****.**",
                Gender = "Male",
                UserName = "******",
                Link = "www.jerry.com",
                CreatedOn = DateTime.Now
            };

               progressTest = new Progress()
               {
               Id = 1,
               Isbn = "OL12345",
               ReaderId = 1,
               Reader = readerTest,
               IsFinished = false
               };

            bookmarksTest = new List<Bookmark>()
            {
                new Bookmark()
                {
                    Id=1, ProgressId=1, Progress=progressTest, PageNumber=20, CreatedOn=DateTime.Now
                },
                new Bookmark()
                {
                    Id=2, ProgressId=1, Progress=progressTest, PageNumber=30, CreatedOn=DateTime.Now
                }
            };
        }