Ejemplo n.º 1
0
        public void Given_color_With_command_as_black()
        {
            //Given: command as 'registration_numbers_for_cars_with_colour black'
            string command = "registration_numbers_for_cars_with_colour black";
            //When: I call VehicleColor object
            string result = _vehicleColor.GetColor(command);
            //Then: I get 'black'
            string expected = "black";

            Assert.AreEqual(expected, result);
        }
Ejemplo n.º 2
0
        public string ExecuteCommand(string command)
        {
            string message = string.Empty;

            try
            {
                string color = _vehicleColor.GetColor(command);
                VehicleDetailsModel[] vehicleDetails = _parkingRepository.GetParkingDetails();
                List <int>            slotList       = _slotByColor.GetSlotNumbers(vehicleDetails, color);
                if (slotList.Count > 0)
                {
                    message = _slotByColorMessage.BuildMessage(slotList);
                }
                else
                {
                    message = "Not found";
                }
                return(message);
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        public string ExecuteCommand(string command)
        {
            string message = string.Empty;

            try
            {
                string color = _vehicleColor.GetColor(command);
                VehicleDetailsModel[] vehicleDetails = _parkingRepository.GetParkingDetails();
                string[] registrationNumber          = _vehicleByColor.GetRegistrationNumbers(vehicleDetails, color);
                if (registrationNumber.Length > 0)
                {
                    message = _vehicleByColorSuccessMessage.BuildMessage(registrationNumber);
                }
                else
                {
                    message = "Not found";
                }
                return(message);
            }
            catch (Exception ex)
            {
                throw;
            }
        }