Ejemplo n.º 1
0
        public void TestForFullCycle()
        {
            ParkingEngine parkingEngine = new ParkingEngine();

            var input1 = new StringReader("B101DDD");

            Console.SetIn(input1);

            parkingEngine.RegisterCarEntry();

            var input2 = new StringReader("B101DDD");

            Console.SetIn(input2);
            parkingEngine.RegisterCarExit();
        }
Ejemplo n.º 2
0
        public void TestForRegisteringACarEntry()
        {
            ParkingEngine parkingEngine = new ParkingEngine();

            var registrationNumber = new StringReader("B101FFF");

            Console.SetIn(registrationNumber);

            var output = new StringWriter();

            Console.SetOut(output);
            parkingEngine.RegisterCarEntry();
            if (output.ToString().Contains("Car Registered Succesfuly!"))
            {
                Assert.IsTrue(true);
            }
            else
            {
                Assert.IsTrue(false);
            }
        }