Пример #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);
 }
Пример #2
0
        public void SerializeDemoMessagesToFile()
        {
            ILocationProvider locationProvider = new MockLocationProvider();
            IMessageParser realMessageParser = new RegexMessageParser(_singletonTagProvider, locationProvider);
            MessageRepository tempMessageRepository = new MessageRepository();
            TagRepository tempTagRepository = new TagRepository();
            IncomingMessageProcessor incomingMessageProcessor = new IncomingMessageProcessor(tempMessageRepository, tempTagRepository, realMessageParser);
            IRawMessageProvider rawMessageProvider = new DemoMessageProvider(incomingMessageProcessor);
            rawMessageProvider.Update();

            tempMessageRepository.FilePath = "../../data/demo_offers.json";
            tempMessageRepository.SerializeToFile();
        }
Пример #3
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();
        }
Пример #4
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();
        }