예제 #1
0
        public void Given_SlotNumnerAs1ThenGet1()
        {
            //Given:
            List <int> slotList = new List <int>();

            slotList.Add(1);
            //When: I call SlotByColorMessage object
            string result = _slotByColorMessage.BuildMessage(slotList);

            //Then:  I get 1
            Assert.AreEqual("1", result);
        }
예제 #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;
            }
        }