public void Should_PostBookingItem()
        {
            BookingItem testBookingItem = new BookingItem {
                Id = 1, Location = 0, AgreedPriceName = "Adult", AgreedPrice = 5, BookingId = 1
            };

            Mock <IUnitOfWork> mock = new Mock <IUnitOfWork>();

            mock.Setup(f => f.BookingItems.Create(testBookingItem)).Returns(true);

            BookingItemsController controller = new BookingItemsController(mock.Object);
            var bookingItems = controller.PostBookingItem(testBookingItem);

            Assert.IsType <CreatedAtActionResult>(bookingItems);
        }
        public void ShouldNot_PostBookingItem_ModelStateError()
        {
            BookingItem testBookingItem = new BookingItem {
                Id = 1, Location = 0, AgreedPriceName = "Adult", AgreedPrice = 5, BookingId = 1
            };

            Mock <IUnitOfWork> mock = new Mock <IUnitOfWork>();

            mock.Setup(f => f.BookingItems.Create(testBookingItem)).Returns(true);
            mock.Setup(f => f.BookingItems.GetById(1)).Returns(testBookingItem);

            BookingItemsController controller = new BookingItemsController(mock.Object);

            controller.ModelState.AddModelError("TestError", "Error");
            var bookingItems = controller.PostBookingItem(testBookingItem);

            Assert.IsType <BadRequestObjectResult>(bookingItems);
        }