示例#1
0
        public void PostGuestTest()
        {
            Guest guest = new Guest();

            guest.Name    = "Edith";
            guest.Surname = "Hanson";

            Random        random = new Random();
            StringBuilder output = new StringBuilder();

            for (int i = 0; i < 11; i++)
            {
                output.Append(random.Next(0, 9));
            }
            guest.PIN = output.ToString();

            var GuestsBefore = _context.Guest.Count();

            _GuestController.PostGuest(guest);
            var GuestsAfter = _context.Guest.Count();

            Assert.IsTrue(GuestsAfter > GuestsBefore, "Count of GuestsAfter is not greater then GuestsBefore.");
        }