Beispiel #1
0
        //[Fact]
        public async Task TestFbPosting()
        {
            var repositoryMock = new Mock <ISocialRepository>();

            repositoryMock
            .Setup(o => o.GetFacebookPages(It.IsAny <int>()))
            .Returns((int id) =>
                     Task.FromResult(new List <FacebookPage>()
            {
                new FacebookPage
                {
                    Token = "token"
                }
            } as IReadOnlyCollection <FacebookPage>));

            ILogger           logger     = new SimpleLogger();
            ISocialRepository repository = repositoryMock.Object;

            var manager = new FacebookCrosspostManager(repository, logger);

            int    categoryId = 1;
            string comment    = "test";
            string link       = "http://example.com";

            await manager.Send(categoryId, comment, link);
        }
Beispiel #2
0
        public ApiController(
            IPublicationManager publicationManager,
            IVacancyManager vacancyManager,
            IUserManager userManager,
            ILocalizationManager localizationManager,
            ILogger logger,
            Settings settings,
            FacebookCrosspostManager facebookCrosspostManager,
            TelegramCrosspostManager telegramCrosspostManager,
            TwitterCrosspostManager twitterCrosspostManager)
        {
            _logger              = logger;
            _settings            = settings;
            _userManager         = userManager;
            _vacancyManager      = vacancyManager;
            _localizationManager = localizationManager;
            _publicationManager  = publicationManager;

            _crossPostManagers = new List <ICrossPostManager>
            {
                facebookCrosspostManager,
                telegramCrosspostManager,
                twitterCrosspostManager
            };
        }
Beispiel #3
0
 public ContentController(
     IMemoryCache cache,
     FacebookCrosspostManager facebookCrosspostCrosspostManager,
     TelegramCrosspostManager telegramCrosspostCrosspostManager)
 {
     _facebookCrosspostCrosspostManager = facebookCrosspostCrosspostManager;
     _telegramCrosspostCrosspostManager = telegramCrosspostCrosspostManager;
 }
Beispiel #4
0
 public HomeController(
     IMemoryCache cache,
     IHostingEnvironment env,
     IVacancyManager vacancyManager,
     IPublicationManager publicationManager,
     Settings settings,
     TelegramCrosspostManager telegramCrosspostManager,
     FacebookCrosspostManager facebookCrosspostManager,
     TwitterCrosspostManager twitterCrosspostManager)
 {
     _cache                    = cache;
     _env                      = env;
     _vacancyManager           = vacancyManager;
     _publicationManager       = publicationManager;
     _settings                 = settings;
     _telegramCrosspostManager = telegramCrosspostManager;
     _facebookCrosspostManager = facebookCrosspostManager;
     _twitterCrosspostManager  = twitterCrosspostManager;
 }