Exemplo n.º 1
0
        private static void Main(string[] args)
        {
            var handler = new CommandHandler(new InMemoryMessageRepository(), new InMemoryUserRepository());

              Console.WriteLine("Social Network");
              Console.WriteLine();

              while (true)
              {
            Console.Write("> ");

            var line = Console.ReadLine();
            if (line == null)
              break;

            var parts = line.Split(' ');
            var user = parts[0];

            if (parts.Length == 1)
              ShowLines(handler.Read(user));
            else if (parts[1] == "->")
              handler.Post(user, string.Join(" ", parts.Skip(2)));
            else if (parts[1] == "follows")
              handler.Follow(user, parts[2]);
            else if (parts[1] == "wall")
              ShowLines(handler.Wall(user));
              }
        }
Exemplo n.º 2
0
 public void SetUp()
 {
     sut = new CommandHandler(new InMemoryMessageRepository(), new InMemoryUserRepository());
 }
Exemplo n.º 3
0
 public void SetUp()
 {
     messages = new Mock<MessageRepository>();
       users = new Mock<UserRepository>();
       sut = new CommandHandler(messages.Object, users.Object);
 }