using System;
using Application;
using Infrastructure.Repositories.Memory;

namespace CLI
{
  class Program
  {
    static void Main(string[] args)
    {
      var linkRepository = new LinkRepository(
        new Domain.Link("http://default.website"),
        new Domain.Link("http://another.website")
      );
      var commentRepository = new CommentRepository();
      var data = new Data(linkRepository, commentRepository);
      var service = new LinkService(linkRepository, data);

      service.PublishLink(new PublishLinkCommand
      {
        Url = "http://an.url"
      });

      service.PublishLink(new PublishLinkCommand
      {
        Url = "http://an.other.url"
      });

      foreach (var link in service.GetAllLinks())
      {
        Console.WriteLine($"{link.Id} - {link.Url}");
      }
    }
  }
}
