コード例 #1
0
        public void EntryTest()
        {
            DateTime initialDateControl = new DateTime(2017, 1, 1, 0, 0, 0);
            DateTime finalDateControl   = new DateTime(2017, 12, 15, 23, 59, 59);
            double   hourPrice          = 5;

            ValidityControl.AddDateControl(hourPrice, initialDateControl, finalDateControl);

            string   board  = "ABC 1236";
            DateTime dateIn = new DateTime(2017, 1, 1, 2, 0, 0);

            VehicleControl.Entry(board, dateIn);

            // deu entrada em um carro no estacionamento, não tem data de saida
            VehicleEntrance vehicleInside = VehicleControl.GetVehicleInside(board);

            Assert.IsTrue(vehicleInside.Board == board && vehicleInside.InvalidDatetime(vehicleInside.DateOut));

            // saida do estacionamento
            VehicleControl.Out(vehicleInside.Board, new DateTime(2017, 1, 1, 2, 30, 0));

            VehicleControl.DeleteVehicleByID(vehicleInside.ID);
        }