예제 #1
0
        public void AddRoomsAndBeds()
        {
            Simulation s = new Simulation();

            s.AddRoomsAndBeds(new int[] { 5, 2 }, new int[] { 2, 2 }, new int[] { 6, 2 }, new int[] { 4, 2 });

            Assert.AreEqual(s.Rooms.Count, 17);
        }
예제 #2
0
        public void Start()
        {
            Simulation s = new Simulation();

            //  s.AddPatient(10);
            s.AddRoomsAndBeds(new int[] { 5, 2 }, new int[] { 2, 2 }, new int[] { 6, 2 }, new int[] { 4, 2 });
            s.Start();

            Assert.AreEqual(s.LimitA, 5);
            Assert.AreEqual(s.LimitB, 2);
            Assert.AreEqual(s.LimitC, 6);
            Assert.AreEqual(s.LimitD, 4);
        }
예제 #3
0
        public void ManagePatients()
        {
            Simulation s = new Simulation();

            s.AddRoomsAndBeds(new int[] { 5, 2 }, new int[] { 2, 2 }, new int[] { 6, 2 }, new int[] { 4, 2 });
            s.AddPatients(10);
            s.Start();
            Assert.AreNotEqual(s.PatientsToNavigate, 0);

            foreach (Patient p in s.PatientsToNavigate)
            {
                Assert.AreNotEqual(p.Bed, null);
                Assert.AreEqual(p.Bed.Busy, true);
            }

            s.Running = false;
        }