Exemple #1
0
        public VoteScannerTests()
        {
            var players = new Player[]
            {
                PlayerGenerator.GeneratePlayer(name: "John0", aliases: new string[] { "John" }),
                PlayerGenerator.GeneratePlayer(name: "Xevious", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "snowbind", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "GMass", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "Liamness", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "spork", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "Alask", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "PaulM", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "Danster", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "gospvg", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "Strategos", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "bennette98", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "Don Wiskerando", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "The Grand Pursuivant", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "Mr. Blonde", aliases: new string[0]),
                PlayerGenerator.GeneratePlayer(name: "Mr. Violet", aliases: new string[] { "Mr Violet", "Violet", "Mr.Violet", "MrViolet" }),
                PlayerGenerator.GeneratePlayer(name: "Mr. Viridian", aliases: new string[] { "Mr.Viridian", "Mr Viridian", "Viridian", "MrViridian" }),
                PlayerGenerator.GeneratePlayer(name: "Moderator", aliases: new string[0], participating: false),
                PlayerGenerator.GeneratePlayer(name: "Player With Aliases", aliases: new string[] { "PlayerWithAliases", "PWA" }),
            };

            var mockRepo = new Mock <IRepository>();

            mockRepo.Setup(m => m.FindAllPlayers())
            .Returns(players);

            this.voteScanner = new VoteScanner(mockRepo.Object, 8);
        }
Exemple #2
0
 public ForumScanner(IRepository repository)
 {
     this.repo                 = repository;
     this.forumAccessor        = new ForumAccessor();
     this.pollInterval         = this.GetInterval();
     this.dayScanner           = new DayScanner(this.repo);
     this.voteScanner          = new VoteScanner(this.repo);
     this.firstForumPostNumber = ConfigurationManager.AppSettings["FirstForumPostNumber"] ?? "1";
 }
 public VoteController(IRepository repo)
 {
     this.repository  = repo;
     this.voteScanner = new VoteScanner(this.repository);
 }