Beispiel #1
0
        public void ReserveOfferTest()
        {
            ReserveOfferDto dto = new ReserveOfferDto()
            {
                Username = "******",
                OfferId  = 2
            };

            IHttpActionResult result = _controller.ReserveOffer(dto);
            var contentResult        = result as OkNegotiatedContentResult <bool>;

            Offer o = _context.Offers.FirstOrDefault(x => x.Id == dto.OfferId);

            Assert.IsNotNull(o);
            Assert.AreEqual(true, o.IsBooked);
            Assert.IsTrue(o.Customer.Username.Equals("jablonskim"));
        }