Beispiel #1
0
        public void TestAddReview()
        {
            Booking booking = new Booking()
            {
                Id            = 1,
                Accommodation = new Accommodation()
                {
                    Name = "b"
                },
                AccommodationId = 1,
                BookingHistory  = new List <BookingStage>(),
                CheckIn         = DateTime.Now,
                CheckOut        = DateTime.Now.AddDays(3),
                GuestId         = 2,
                Guests          = new List <Guest>(),
                HeadGuest       = new Tourist()
                {
                    Email = "*****@*****.**"
                },
                TotalPrice = 35
            };

            this._context.Bookings.Add(booking);
            Review review = new Review()
            {
                Id        = 1,
                BookingId = 1,
                Comment   = "Bueni",
                Score     = 5
            };
            var repository = new ReviewRepository(_context);

            repository.AddAndSave(review);

            Assert.AreEqual(_context.Find <Review>(1), review);
        }