Example #1
0
 public ActivityAction(ILogger <ActivityAction> logger, IOptions <InstagramOptions> instagramOptions, SeleniumWrapper seleniumWrapper) // DI : constructor must be public
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _logger.LogTrace("new ActivityAction()");
     _instagramOptions = instagramOptions.Value ?? throw new ArgumentNullException(nameof(instagramOptions));
     _seleniumWrapper  = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
 }
Example #2
0
 public UnfollowUnfollowersAction(ILogger<UnfollowUnfollowersAction> logger, IOptions<UnfollowUnfollowersOptions> unfollowUnfollowersOptions, IOptions<InstagramOptions> instagramOptions, SeleniumWrapper seleniumWrapper, PersistenceManager persistenceManager, WaitAction waitAction) // DI : constructor must be public
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _logger.LogTrace("new UnfollowUnfollowers()");
     _unfollowUnfollowersOptions = unfollowUnfollowersOptions.Value ?? throw new ArgumentNullException(nameof(unfollowUnfollowersOptions));
     _instagramOptions = instagramOptions.Value ?? throw new ArgumentNullException(nameof(instagramOptions));
     _seleniumWrapper = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
     _persistenceManager = persistenceManager ?? throw new ArgumentNullException(nameof(persistenceManager));
     _waitAction = waitAction ?? throw new ArgumentNullException(nameof(waitAction));
 }
Example #3
0
 public DumpingAction(ILogger <DumpingAction> logger, IOptions <DumpingOptions> dumpingOptions, SeleniumWrapper seleniumWrapper, PersistenceManager persistenceManager) // DI : constructor must be public
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _logger.LogTrace("new DumpAction()");
     _dumpingOptions     = dumpingOptions?.Value ?? throw new ArgumentNullException(nameof(dumpingOptions));
     _seleniumWrapper    = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
     _persistenceManager = persistenceManager ?? throw new ArgumentNullException(nameof(persistenceManager));
 }
Example #4
0
        public ExplorePhotosAction(ILogger <ExplorePhotosAction> logger, IOptions <ExplorePhotosOptions> explorePhotosPageActionsOptions, IOptions <InstagramOptions> instagramOptions, SeleniumWrapper seleniumWrapper, WaitAction waitAction) // DI : constructor must be public
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _logger.LogTrace("new ExplorePhotosAction()");
            _explorePhotosPageActionsOptions = explorePhotosPageActionsOptions.Value ?? throw new ArgumentNullException(nameof(explorePhotosPageActionsOptions));
            _instagramOptions = instagramOptions.Value ?? throw new ArgumentNullException(nameof(instagramOptions));
            _seleniumWrapper  = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
            _waitAction       = waitAction ?? throw new ArgumentNullException(nameof(waitAction));

            // default
            DoFollow = true;
            DoLike   = true;
        }
Example #5
0
        public HomeAction(ILogger <HomeAction> logger, IOptions <HomePageOptions> homePageActionsOptions, IOptions <InstagramOptions> instagramOptions, SeleniumWrapper seleniumWrapper, WaitAction waitAction) // DI : constructor must be public
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _logger.LogTrace("new HomeAction()");
            _homePageActionsOptions = homePageActionsOptions.Value ?? throw new ArgumentNullException(nameof(homePageActionsOptions));
            _instagramOptions       = instagramOptions.Value ?? throw new ArgumentNullException(nameof(instagramOptions));
            _seleniumWrapper        = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
            _waitAction             = waitAction ?? throw new ArgumentNullException(nameof(waitAction));

            // default
            DoLike = true;
        }
Example #6
0
        public SnapshootAction(ILogger <SnapshootAction> logger, IOptions <SnapshootOptions> snapshootOptions, PersistenceManager persistenceManager, SeleniumWrapper seleniumWrapper) // DI : constructor must be public
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _logger.LogTrace("new SnapshootAction()");
            _snapshootOptions   = snapshootOptions.Value ?? throw new ArgumentNullException(nameof(snapshootOptions));
            _seleniumWrapper    = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
            _persistenceManager = persistenceManager ?? throw new ArgumentNullException(nameof(persistenceManager));

            // config check
            if (_snapshootOptions.MakeSnapShootEachSeconds <= 0)
            {
                throw new ArgumentOutOfRangeException(nameof(snapshootOptions), "MakeSnapShootEachSeconds must be greater than 0 when SNAPSHOOT tasks are used !");
            }

            // default
            EnableTask = true;
        }
Example #7
0
 public FollowBackAction(ILogger <FollowBackAction> logger, IOptions <FollowBackOptions> followBackOptions, IOptions <InstagramOptions> instagramOptions, SeleniumWrapper seleniumWrapper, WaitAction waitAction) // DI : constructor must be public
 {
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
     _logger.LogTrace("new FollowBackAction()");
     _followBackOptions = followBackOptions.Value ?? throw new ArgumentNullException(nameof(followBackOptions));
     _instagramOptions  = instagramOptions.Value ?? throw new ArgumentNullException(nameof(instagramOptions));
     _seleniumWrapper   = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
     _waitAction        = waitAction ?? throw new ArgumentNullException(nameof(waitAction));
 }
        public LoggingAction(ILogger <LoggingAction> logger, IOptions <LoggingOptions> loggingOptions, IOptions <LoggingSecretOptions> loggingSecretOptions, IOptions <InstagramOptions> instagramOptions, SeleniumWrapper seleniumWrapper, PersistenceManager persistenceManager) // DI : constructor must be public
        {
            _logger = logger ?? throw new ArgumentNullException(nameof(logger));
            _logger.LogTrace("new LoggingAction()");
            _loggingOptions       = loggingOptions?.Value ?? throw new ArgumentNullException(nameof(loggingOptions));
            _loggingSecretOptions = loggingSecretOptions?.Value ?? throw new ArgumentNullException(nameof(loggingSecretOptions));
            _instagramOptions     = instagramOptions.Value ?? throw new ArgumentNullException(nameof(instagramOptions));
            _seleniumWrapper      = seleniumWrapper ?? throw new ArgumentNullException(nameof(seleniumWrapper));
            _persistenceManager   = persistenceManager ?? throw new ArgumentNullException(nameof(persistenceManager));

            // config check
            if (string.IsNullOrWhiteSpace(_loggingOptions.User))
            {
                throw new ArgumentNullException(nameof(loggingOptions), "User is empty !");
            }
        }