예제 #1
0
        static void Main(string[] args)
        {
            string comand = args[0];

            switch (comand)
            {
            case "convert":
                string url  = args[1];
                string path = args[2];

                var logFacade = new LogFacade(
                    new LogService(new LogClient(
                                       WebRequest.CreateHttp(url)
                                       ))
                    , new LogFile(path)
                    );

                logFacade.ConvertLog();
                break;

            default:
                Console.WriteLine("Comand not found");
                break;
            }
        }
예제 #2
0
        public void CheckValues()
        {
            //Arrange
            MockLogClient logClient  = new MockLogClient();
            MockLogFile   logFile    = new MockLogFile();
            LogService    logService = new LogService(logClient);
            var           logFacade  = new LogFacade(logService, logFile);

            //Act
            logFacade.ConvertLog();

            //Assert
            Assert.Contains("robots.txt", logFile.content);
            Assert.Contains("myImages", logFile.content);
            Assert.Contains("not-found", logFile.content);
        }