public void KeyExtractorExtraeLaUltimaParteDeLaKcy()
        {
            string compartir = "http://kcy.me/9ihs";

            var extractor = new KeyWordExtractor();

            string keyword = extractor.ExtractKeyword(compartir);

            keyword.Should().Be("9ihs");
        }
Exemplo n.º 2
0
        public void ShareKcy()
        {
            var settings = new TestSettings();

            var kcyConnector = new KarmakracyConnector(settings);
            var keyExtractor = new KeyWordExtractor();

            var kcyService = new KarmakracyService(kcyConnector, keyExtractor);

            string kcy = kcyService.Short("http://www.katayunos.com");

            kcyService.Share("Hola Katayuners", kcy);
        }
        public void Initialize()
        {
            extractor = new KeyWordExtractor();
            mockConnector = new Mock<IKarmacracyConnector>();

            mockConnector.Setup(x => x.ShortLink(It.IsAny<string>()))
                        .Returns("http://kcy.me/9ihs")
                        .Verifiable();

            mockConnector.Setup(x => x.ShareKcy(It.IsAny<string>(), It.IsAny<string>()))
                        .Verifiable();

            kcyConnector = mockConnector.Object;
        }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to The AWESOME Karmakracy URL Dispatcher!!!!!!!!!!");

            var connector = new KarmakracyConnector(Properties.Settings.Default);
            var keyExtractor = new KeyWordExtractor();
            var kcyService = new KarmakracyService(connector, keyExtractor);

            var plainTextParser = new PlainTextParser(kcyService);
            var daemon = new MailDaemon(plainTextParser, kcyService, Properties.Settings.Default);

            daemon.Start();

            Console.ReadLine();
        }
 public KarmakracyService(IKarmacracyConnector connector, KeyWordExtractor extractor)
 {
     this.connector = connector;
     this.extractor = extractor;
 }