private static void AddNormalCommands(Cli cli, ILog log, IStorage storage, ITwitterGateway twitter) { var credentials = new KeyStored <Credentials>(storage, "Credentials", () => Credentials.Invalid); var tweetTasks = new KeyStored <ScheduledTasks>(storage, "TweetTasks", () => new ScheduledTasks()); var likeTasks = new KeyStored <ScheduledTasks>(storage, "LikeTasks", () => new ScheduledTasks()); var tweet = new Tweet(twitter, log); var like = new Like(twitter, log); var automatonData = new KeyStored <RandomLikeAutomatonData>(storage, "AutomatonData", () => new RandomLikeAutomatonData()); var likeAutomaton = new RandomLikeAutomaton(automatonData, likeTasks, like, twitter, log); var rawCommands = new List <Command> { new SetupCommand(credentials, log), new ViewCredentials(credentials, log), new ScheduleTweet(tweetTasks, tweet, log), new ViewTasks(tweetTasks, log), new Run(tweetTasks, likeTasks, cli, likeAutomaton, log), new Cancel(tweetTasks, log), tweet, like, new SetMaxLikes(automatonData, twitter, log) }; cli.AddCommands(rawCommands .Select(x => new WithDisplayedUsername(log, credentials, x)) .Concat(new List <ICommand> { new Help(rawCommands.ToDictionary(x => x.Name, x => x), log) }) .ToArray()); }
public static Cli Init(ILog log, IStorage storage, ITwitterGateway twitter) { var cli = new Cli(log); AddNormalCommands(cli, log, storage, twitter); return(cli); }
public RandomLikeAutomaton(IStored <RandomLikeAutomatonData> data, IStored <ScheduledTasks> tasks, Like like, ITwitterGateway twitter, ILog log) { _data = data; _tasks = tasks; _like = like; _twitter = twitter; _log = log; }
public Like(ITwitterGateway twitter, ILog log) { _twitter = twitter; _log = log; }
public SetMaxLikes(IStored <RandomLikeAutomatonData> data, ITwitterGateway twitter, ILog log) { _data = data; _twitter = twitter; _log = log; }
public Tweet(ITwitterGateway twitter, ILog log) { _twitter = twitter; _log = log; }