public void CanCreateScrabbleManager()
 {
     gameFactory = Substitute.For <IGameFactory>();
     board       = new Board();
     drawer      = Substitute.For <ITileDrawer>();
     goHandler   = Substitute.For <IGoHandler>();
     aiGoHandler = Substitute.For <IAiGoHandler>();
     gameList    = Substitute.For <IGameRepository>();
     manager     = new ScrabbleManager(gameFactory, board, drawer, goHandler, aiGoHandler, gameList);
 }
Exemple #2
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;
 }
 public ScrabbleManager(
     IGameFactory gameFactory,
     Board board,
     ITileDrawer drawer,
     IGoHandler goHandler,
     IAiGoHandler aiGoHandler,
     IGameRepository gameRepo)
 {
     this.gameFactory = gameFactory;
     this.board       = board;
     this.drawer      = drawer;
     this.goHandler   = goHandler;
     this.aiGoHandler = aiGoHandler;
     this.gameRepo    = gameRepo;
 }
        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);
        }
Exemple #5
0
 /// <summary>
 /// Sets the tile drawer
 /// </summary>
 /// <param name="drawer">The new drawer that should be used</param>
 public static void SetTileDrawer(ITileDrawer drawer)
 {
     tileDrawer = drawer;
 }