コード例 #1
0
        public void Setup()
        {
            carParkService = CarParkServiceFactory.Build(CarParkModelType.SmartModel);

            string filePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), $"File{Path.DirectorySeparatorChar}file_input.txt");

            if (File.Exists(filePath))
            {
                commands = File.ReadAllLines(filePath);
            }
            else
            {
                Console.WriteLine($"Unable to locate file path: {filePath}");
            }

            filePath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), $"File{Path.DirectorySeparatorChar}file_output.txt");

            if (File.Exists(filePath))
            {
                source_results = File.ReadAllLines(filePath);
            }
            else
            {
                Console.WriteLine($"Unable to locate file path: {filePath}");
            }
        }
コード例 #2
0
        public void Setup()
        {
            carParkService = CarParkServiceFactory.Build(CarParkModelType.SmartModel);

            string input = "create_parking_lot 6";

            carParkService.Execute(input);
        }
コード例 #3
0
ファイル: StatusTest.cs プロジェクト: chuaxiangjie/ParkingApp
        public void Setup()
        {
            carParkService = CarParkServiceFactory.Build(CarParkModelType.SmartModel);

            string input = "create_parking_lot 10";

            carParkService.Execute(input);

            var parkInputs = TestHelper.Generate6ParkCarInputs();

            foreach (var parkInput in parkInputs)
            {
                carParkService.Execute(parkInput.Key);
            }
        }
コード例 #4
0
        static void Main(string[] args)
        {
            IClientCarParkService carParkService = CarParkServiceFactory.Build(CarParkModelType.SmartModel);

            int numberOfArguments = args.Length;

            if (numberOfArguments > 0)
            {
                // Execute commands via file
                ProcessFromFile(carParkService, args[0]);
            }
            else
            {
                // Execute commands via interactive console
                ProcessFromConsole(carParkService);
            }
        }
コード例 #5
0
 public void Setup()
 {
     carParkService = CarParkServiceFactory.Build(CarParkModelType.SmartModel);
 }