public void TestReservationPossible()
        {
            List <Reservation> reservations = new List <Reservation>();
            Reservation        res          = new Reservation();

            res.customerID   = 0;
            res.name         = "Dorota";
            res.surname      = "Plot";
            res.mobileNumber = "12341234";
            res.bookingFrom  = DateTime.Parse("2020-09-09");
            res.bookingUntil = DateTime.Parse("2020-09-14");
            res.roomNumber   = "20";
            reservations.Add(res);
            res.customerID   = 1;
            res.name         = "Ewa";
            res.surname      = "Las";
            res.mobileNumber = "12341234";
            res.bookingFrom  = DateTime.Parse("2020-09-20");
            res.bookingUntil = DateTime.Parse("2020-09-24");
            res.roomNumber   = "20";
            reservations.Add(res);

            var result = RoomChecker.isRoomAvailable(DateTime.Parse("2020-09-15"), DateTime.Parse("2020-09-19"), reservations);

            Assert.IsTrue(result);
        }
Beispiel #2
0
        public static void Bed(User user)
        {
            RoomChecker.SpawnBuilding(user, 1, new Vector3i(5, 5, 5), user.Player.Position.XYZi + Vector3i.Down - new Vector3i(2, 0, 2));
            var bed = WorldObjectDebugUtil.SpawnAndClaim <BedComponent>("WoodenFabricBedObject", user, user.Position.XYZi + Vector3i.Forward);

            Task.Delay(2000).Wait();
            bed.Sleep(user.Player);
        }
        public static void SpawnBed(User user)
        {
            RoomChecker.SpawnBuilding(user, 1, new Vector3i(5, 5, 5), user.Player.Position.Round + Vector3i.Down - new Vector3i(2, 0, 2));
            var bed = WorldObjectUtil.SpawnAndClaim <BedComponent>("WoodenFabricBedObject", user, user.Position.Round + Vector3i.Forward);

            Thread.Sleep(2000);
            bed.Sleep(user.Player);
        }
        public void TestReservationImpossible()
        {
            List <Reservation> reservations = new List <Reservation>();
            Reservation        res          = new Reservation();

            res.customerID   = 0;
            res.name         = "Paweł";
            res.surname      = "RAk";
            res.mobileNumber = "12341234";
            res.bookingFrom  = DateTime.Parse("2020-09-09");
            res.bookingUntil = DateTime.Parse("2020-09-19");
            res.roomNumber   = "20";
            reservations.Add(res);

            var result = RoomChecker.isRoomAvailable(DateTime.Parse("2020-09-09"), DateTime.Parse("2020-09-10"), reservations);

            Assert.IsFalse(result);
        }