Exemple #1
0
 public GoHandler(
     IGoValidator validator,
     ITileDrawer drawer,
     IGoWordFinder goWordFinder,
     IGoWordValidator goWordValidator,
     IGoScorer goScorer,
     IGoMessageMaker goMessageMaker)
 {
     this.validator       = validator;
     this.drawer          = drawer;
     this.goWordFinder    = goWordFinder;
     this.goWordValidator = goWordValidator;
     this.goScorer        = goScorer;
     this.goMessageMaker  = goMessageMaker;
 }
Exemple #2
0
 public AiGoHandler(
     IAiGridModel aiGridModel,
     WordFindable wordFinder,
     IAiGoWordFinder goWordFinder,
     WordValidatable wordValidator,
     IGoScorer goScorer,
     IAiGoPlacer goPlacer)
 {
     this.aiGridModel   = aiGridModel;
     this.goWordFinder  = goWordFinder;
     this.wordFinder    = wordFinder;
     this.wordValidator = wordValidator;
     this.goScorer      = goScorer;
     this.goPlacer      = goPlacer;
 }
        public void Setup()
        {
            game            = new GameFactory(Substitute.For <IDateTimeOffset>()).NewGame("Player");
            goValidator     = Substitute.For <IGoValidator>();
            drawer          = Substitute.For <ITileDrawer>();
            goWordFinder    = Substitute.For <IGoWordFinder>();
            goWordValidator = Substitute.For <IGoWordValidator>();
            goScorer        = Substitute.For <IGoScorer>();
            goMessageMaker  = Substitute.For <IGoMessageMaker>();
            goHandler       = new GoHandler(goValidator, drawer, goWordFinder, goWordValidator, goScorer, goMessageMaker);
            var goWordValidatorResult = new GoValidationResult()
            {
                IsValid = true
            };

            goWordValidator.ValidateWords(Arg.Any <IEnumerable <GoWord> >()).Returns(goWordValidatorResult);
        }
        public void SetUp()
        {
            game = new GameFactory(Substitute.For <IDateTimeOffset>()).NewGame("Player");
            game.Players[0].Tiles.Add(new Tile()
            {
                Letter = 'A'
            });

            aiGridModel = Substitute.For <IAiGridModel>();
            candidates  = new List <AiCandidate>();
            playerTiles = new List <Tile>();
            aiGridModel.Candidates.Returns(candidates);
            aiGridModel.PlayerTiles.Returns(playerTiles);

            wordFinder    = Substitute.For <WordFindable>();
            goWordFinder  = Substitute.For <IAiGoWordFinder>();
            wordValidator = Substitute.For <WordValidatable>();
            goScorer      = Substitute.For <IGoScorer>();
            goPlacer      = Substitute.For <IAiGoPlacer>();
            aiGoHandler   = new AiGoHandler(aiGridModel, wordFinder, goWordFinder, wordValidator, goScorer, goPlacer);

            goResult = null;
        }