Esempio n. 1
0
 public void Setup()
 {
     TagRepository tagRepository = new TagRepository();
     tagRepository.FilePath = "data/initial_tags.json";
     tagRepository.InitializeFromFile();
     ILocationProvider locationProvider = new MockLocationProvider();
     _parser = new RegexMessageParser(tagRepository, locationProvider);
 }
Esempio n. 2
0
        public TestSerialization()
        {
            _singletonTagProvider = new TagRepository();
            _singletonTagProvider.FilePath = "data/initial_tags.json";
            _singletonTagProvider.InitializeFromFile();
            ILocationProvider locationProvider = new MockLocationProvider();

            IMessageParser realMessageParser = new RegexMessageParser(_singletonTagProvider, locationProvider);
            _messageRepository = new MessageRepository();
            _tagRepository = new TagRepository();
            IncomingMessageProcessor incomingMessageProcessor = new IncomingMessageProcessor(_messageRepository, _tagRepository, realMessageParser);
            IRawMessageProvider rawMessageProvider = new MockRawMessageProvider(incomingMessageProcessor);
            rawMessageProvider.Update();
        }
Esempio n. 3
0
        public void InitializeTwitterProvider()
        {
            //for this test create real objects all the way down the line - so...more of an integration test really
            // (which is why this is disabled)
            TagRepository singletonTagProvider = new TagRepository();
            singletonTagProvider.FilePath = "data/initial_tags.json";
            singletonTagProvider.InitializeFromFile();

            ILocationProvider locationProvider = new MockLocationProvider();
            RegexMessageParser realMessageParser = new RegexMessageParser(singletonTagProvider, locationProvider);
            _messageRepository = new MessageRepository();
            _tagRepository = new TagRepository();
            IncomingMessageProcessor target = new IncomingMessageProcessor(_messageRepository, _tagRepository, realMessageParser);
            TwitterRawMessageProvider twitterProvider = new TwitterRawMessageProvider((IRawMessageReceiver)target, new MockWebRequestFactory());
            twitterProvider.Update();
        }