예제 #1
0
        public void TestInitialize()
        {
            codurer = new Codurer(UserServiceFactory.GetInMemoryUserService());
            now = DateTime.Now;
            commandExecutor =
                new CommandExecutor(codurer, CommandDescriptorFactory.GetCommandDescriptors());

            PostAliceMessages();
            PostBobMessages();
        }
예제 #2
0
파일: Program.cs 프로젝트: vgaltes/Codurer
        static void Main(string[] args)
        {
            var userService = UserServiceFactory.GetInMemoryUserService();
            var codurer = new Codurer(userService);
            var commandExecutor =
                new CommandExecutor(codurer, CommandDescriptorFactory.GetCommandDescriptors());
            var quitString = "!q";

            Console.Write(">");
            string commandLine = Console.ReadLine();

            while (commandLine != quitString)
            {
                var commandResult = commandExecutor.ExecuteCommand(commandLine);
                foreach (string wallMessage in commandResult.Messages)
                {
                    Console.WriteLine(wallMessage);
                }

                Console.Write(">");
                commandLine = Console.ReadLine();
            }
        }