Exemplo n.º 1
0
        public void fillRoomsTest()
        {
            int expected = 10;

            dataGenerator = new BigRandomDataGenerator(10);
            dataGenerator.fillRooms(rooms);
            int result = rooms.Count();

            Assert.AreEqual(expected, result, 0.0);
        }
Exemplo n.º 2
0
        public void fillReservationTest()
        {
            int expected = 10;

            dataGenerator = new BigRandomDataGenerator(10);
            dataGenerator.fillRooms(rooms);
            dataGenerator.fillCustomers(customers);
            dataGenerator.fillReservations(customers, rooms, reservations);
            int result = reservations.Count();

            Assert.AreEqual(expected, result, 0.0);
        }
Exemplo n.º 3
0
        public void ListPerformanceTest()
        {
            using (testOutput = new System.IO.StreamWriter(path, false))
            {
                testOutput.WriteLine("List perfomance test");
                List <Room> rooms = new List <Room>();
                for (int i = 2; i < 24; i++)
                {
                    bigDataGenerator = new BigRandomDataGenerator((int)Math.Pow(2, i));
                    stopper.Reset();

                    stopper.Start();
                    bigDataGenerator.fillRooms(rooms);
                    stopper.Stop();

                    testOutput.WriteLine("no. of elements: " + ((int)Math.Pow(2, i)).ToString().PadLeft(8)
                                         + " time elapsed(ms): " + stopper.ElapsedMilliseconds.ToString().PadLeft(6));
                }
            }
        }
Exemplo n.º 4
0
        public void ObservableCollectionPerformanceTest()
        {
            using (testOutput = new System.IO.StreamWriter(path, false))
            {
                testOutput.WriteLine("ObservableCollection perfomance test");
                Dictionary <int, Customer> customers = new Dictionary <int, Customer>();
                List <Room> rooms = new List <Room>();
                ObservableCollection <Reservation> reservations = new ObservableCollection <Reservation>();
                for (int i = 2; i < 24; i++)
                {
                    bigDataGenerator = new BigRandomDataGenerator((int)Math.Pow(2, i));
                    bigDataGenerator.fillCustomers(customers);
                    bigDataGenerator.fillRooms(rooms);

                    stopper.Reset();
                    stopper.Start();
                    bigDataGenerator.fillReservations(customers, rooms, reservations);
                    stopper.Stop();

                    testOutput.WriteLine("no. of elements: " + ((int)Math.Pow(2, i)).ToString().PadLeft(8)
                                         + " time elapsed(ms): " + stopper.ElapsedMilliseconds.ToString().PadLeft(6));
                }
            }
        }
Exemplo n.º 5
0
 public void fillReservationWithEmptyCustomersListTest()
 {
     dataGenerator = new BigRandomDataGenerator(10);
     dataGenerator.fillRooms(rooms);
     dataGenerator.fillReservations(customers, rooms, reservations);
 }