Ejemplo n.º 1
0
 public PostCommand(User user, ITweetsRepository tweetsRepository, ParsedInput parsedInput, TextWriter textWriter)
 {
     _user = user;
     _tweetsRepository = tweetsRepository;
     _parsedInput = parsedInput;
     _textWriter = textWriter;
 }
Ejemplo n.º 2
0
        public ICommand Create(User user,
            ParsedInput parsedInput,
            ITweetsRepository tweetsRepository,
            TextWriter textWriter)
        {
            switch (parsedInput.CommandType)
            {
                case CommandType.Read:
                {
                    return new ReadCommand(user, tweetsRepository, textWriter, parsedInput);
                }
                case CommandType.Follow:
                {
                    return new FollowCommand(user, new User(parsedInput.RequiredAction), textWriter);
                }
                case CommandType.Wall:

                {
                    return new WallCommand(user, tweetsRepository, textWriter, parsedInput);
                }
                case CommandType.Post:
                default:
                {
                    return new PostCommand(user, tweetsRepository, parsedInput, textWriter);
                }
            }
        }
 private TwitterStreamingListener(ITweetsRepository injected)
 {
     this._stopSearch = false;
     this._repository = injected;
     this._otherEvents = new List<string>();
     this._translationService = new ModelTranslationService();
 }
 public TweetProcessor(ITweetsRepository tweetsRepository, ITextAnalyticsConfiguration configuration,
                       HttpClient httpClient)
 {
     _tweetsRepository = tweetsRepository;
     _httpClient       = httpClient;
     _httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", $"{configuration.Key1}");
 }
Ejemplo n.º 5
0
 public WallCommand(User user, ITweetsRepository tweetsRepository, TextWriter textWriter, ParsedInput parsedInput)
 {
     _user = user;
     _tweetsRepository = tweetsRepository;
     _textWriter = textWriter;
     _parsedInput = parsedInput;
 }
 private TwitterStreamingListener(ITweetsRepository injected)
 {
     this._stopSearch         = false;
     this._repository         = injected;
     this._otherEvents        = new List <string>();
     this._translationService = new ModelTranslationService();
 }
 public void GivenTheApplicationIsAwaitingACommand()
 {
     _tweetsRepository = new TweetsRepository();
     _usersRepository = new UsersRepository();
     _inputParser = new InputParser();
     _textWriter = new StringWriter();
     _program = new Program(_tweetsRepository, _usersRepository, _inputParser, new CommandFactory(), _textWriter);
 }
 public static TwitterStreamingListener GetInstance(ITweetsRepository repository)
 {
     if (_instance == null)
     {
         _instance = new TwitterStreamingListener(repository);
     }
     return _instance;
 }
 public static TwitterStreamingListener GetInstance(ITweetsRepository repository)
 {
     if (_instance == null)
     {
         _instance = new TwitterStreamingListener(repository);
     }
     return(_instance);
 }
 public TweetsManager(ITweetsRepository tweetsRepository, IImagesRepository imagesRepository,
                      INotificationEnqueue queue, UserManager <ApplicationUser> userManager)
 {
     _tweetsRepository = tweetsRepository;
     _imagesRepository = imagesRepository;
     _queue            = queue;
     _userManager      = userManager;
 }
Ejemplo n.º 11
0
 public Program(ITweetsRepository tweetsRepository, IUsersRepository usersRepository, InputParser inputParser, CommandFactory commandFactory, TextWriter textWriter)
 {
     _tweetsRepository = tweetsRepository;
     _usersRepository = usersRepository;
     _inputParser = inputParser;
     _commandFactory = commandFactory;
     _textWriter = textWriter;
     _consoleWriter = new ConsoleWriter(_textWriter);
 }
Ejemplo n.º 12
0
 public Program()
 {
     _textWriter = Console.Out;
     _consoleWriter = new ConsoleWriter(_textWriter);
     _commandFactory = new CommandFactory();
     _inputParser = new InputParser();
     _tweetsRepository = new TweetsRepository();
     _usersRepository = new UsersRepository();
 }
Ejemplo n.º 13
0
 public HomeController(
     ITweetsLogic tweetsLogic,
     ISearchLogic searchLogic,
     ITwitterSearchRepository twitterSearchRepository,
     ITwitterAppRepository twitterAppRepository,
     ITweetsRepository tweetsRepository)
 {
     _tweetsLogic = tweetsLogic;
     _searchLogic = searchLogic;
     _twitterSearchRepository = twitterSearchRepository;
     _twitterAppRepository = twitterAppRepository;
     _tweetsRepository = tweetsRepository;
 }
Ejemplo n.º 14
0
 public HomeController(
     ITweetsLogic tweetsLogic,
     ISearchLogic searchLogic,
     ITwitterSearchRepository twitterSearchRepository,
     ITwitterAppRepository twitterAppRepository,
     ITweetsRepository tweetsRepository)
 {
     _tweetsLogic             = tweetsLogic;
     _searchLogic             = searchLogic;
     _twitterSearchRepository = twitterSearchRepository;
     _twitterAppRepository    = twitterAppRepository;
     _tweetsRepository        = tweetsRepository;
 }
Ejemplo n.º 15
0
 public void Initialize()
 {
     newTweet = new Tweet
     {
         user_id   = 3,
         text      = "This is a unit test4444!",
         post_date = DateTime.Parse("2016-05-13 14:46:29.387")
     };
     tweet = new List <Tweet>
     {
         new Tweet
         {
             id        = 48,
             user_id   = 58,
             text      = "This is Didina's First Post!",
             post_date = DateTime.Parse("2016-05-10 13:50:32.820")
         },
         new Tweet
         {
             id        = 49,
             user_id   = 61,
             text      = "This is Eugen's First Post!",
             post_date = DateTime.Parse("2016-05-10 13:50:47.957")
         },
         new Tweet
         {
             id        = 50,
             user_id   = 59,
             text      = "This is Valeriu's First Post!",
             post_date = DateTime.Parse("2016-05-10 13:51:43.610")
         },
     }.AsQueryable();
     mockSet     = new Mock <DbSet <Tweet> >();
     mockContext = new Mock <Twitter_dbEntities>();
     mockContext.Setup(tweets => tweets.Tweets).Returns(mockSet.Object);
     service = new TweetsRepository(mockContext.Object);
     mockSet.As <IQueryable <Tweet> >().Setup(m => m.Provider).Returns(tweet.Provider);
     mockSet.As <IQueryable <Tweet> >().Setup(m => m.Expression).Returns(tweet.Expression);
     mockSet.As <IQueryable <Tweet> >().Setup(m => m.ElementType).Returns(tweet.ElementType);
     mockSet.As <IQueryable <Tweet> >().Setup(m => m.GetEnumerator()).Returns(tweet.GetEnumerator());
 }
Ejemplo n.º 16
0
 public TweetsLogic(ITweetsRepository tweetsRepository)
 {
     _tweetsRepository = tweetsRepository;
 }
Ejemplo n.º 17
0
 public TweetsController(ITweetsRepository repository, INotificationEnqueue queue)
 {
     _repository = repository;
     _queue      = queue;
 }
Ejemplo n.º 18
0
 public TweetsService(ITweetsRepository tweetsRepository, IMapper mapper)
 {
     _tweetsRepository = tweetsRepository;
     _mapper           = mapper;
 }
Ejemplo n.º 19
0
 public TweetBL(ITweetsRepository tweetsRepository, ITweetMapper tweetMapper)
 {
     BasicConfigurator.Configure();
     this.tweetsRepository = tweetsRepository;
     this.tweetMapper      = tweetMapper;
 }
Ejemplo n.º 20
0
 public TweetsController(ITweetsRepository repository, INotificationEnqueue queue, UserManager <ApplicationUser> userManager)
 {
     _repository  = repository;
     _queue       = queue;
     _userManager = userManager;
 }
Ejemplo n.º 21
0
 public TwitterAccessService()
 {
     factory    = new RepositoryFactory();
     repository = factory.GetTwitterRepository();
     listener   = TwitterStreamingListener.GetInstance(repository);
 }
Ejemplo n.º 22
0
 public TweetsLogic(ITweetsRepository tweetsRepository)
 {
     _tweetsRepository = tweetsRepository;
 }
Ejemplo n.º 23
0
        public MainPageViewModel(
            IPageNavigationService pageNavigationService,
            IItemsService dataService,
            ITweetsService tweetsService,
            IVideosService youtubeChannelService,
            ISettingsService settingsService,
            IUnityContainer unityContainer,
            IItemsRepository itemsRepository,
            ITweetsRepository tweetsRepository,
            IImagesRepository imagesRepository,
            IVideosRepository videosRepository,
            ICarsRepository carsRepository,
            IFlickrService flickrService,
            ISharingService sharingService)
            : base(
                sharingService,
                pageNavigationService,
                unityContainer)
        {
            _pageNavigationService = pageNavigationService;
            _dataService = dataService;
            _tweetsService = tweetsService;
            _youtubeChannelService = youtubeChannelService;
            _unityContainer = unityContainer;
            _itemsRepository = itemsRepository;
            _tweetsRepository = tweetsRepository;
            _imagesRepository = imagesRepository;
            _videosRepository = videosRepository;
            _flickrService = flickrService;
            _carsRepository = carsRepository;

            //CarModelsCollection = carsRepository.GetAll();

#if WINDOWS_PHONE
            if (DesignerProperties.IsInDesignTool)
#else // !WINDOWS_PHONE
			if (DesignMode.DesignModeEnabled)
#endif
            {
                //InitializeDataForDesignMode();
                InitializeDataFromOnlineAsync();
            }
        }
Ejemplo n.º 24
0
 public Timeline(ITweetsRepository tweetsRepository, DateTime currentTime)
 {
     _tweetsRepository = tweetsRepository;
     _currentTime = currentTime;
 }