Exemplo n.º 1
0
        public static void Run()
        {
            // We can add/remove handlers and change the order.
            // Authenticator -> Logger -> compressor
            var compressor    = new Compressor(null);
            var logger        = new Logger(compressor);
            var Authenticator = new Authenticator(logger);

            var webserver = new Webserver(Authenticator);

            // Valid user
            webserver.Handle(new HttpRequest("admin", "1234"));
            // False user
            System.Console.WriteLine();
            webserver.Handle(new HttpRequest("faker", "124"));
        }