void GivenPlayerHasNoMoreTiles() { var validationResult = new GoValidationResult() { IsValid = true }; goValidator.ValidateGo(game).Returns(validationResult); }
void GivenAValidGo() { var validationResult = new GoValidationResult() { IsValid = true, Message = "go is valid" }; goValidator.ValidateGo(game).Returns(validationResult); }
void GivenAnotherPlayerHasNoTiles() { var validationResult = new GoValidationResult() { IsValid = true }; goValidator.ValidateGo(game).Returns(validationResult); game.CurrentPlayer().Tiles.Add(new Tile()); }
void GivenAGoScored12Points() { var validationResult = new GoValidationResult() { IsValid = true }; goValidator.ValidateGo(game).Returns(validationResult); goScorer.ScoreGo(Arg.Any <IEnumerable <GoWord> >()).Returns(12); }
void GivenAValidGoWithAPlayerTilePlacedOnBoard() { game.CurrentPlayer().Tiles.Add(new Tile('A') { Location = "board", BoardPositionX = 7, BoardPositionY = 7 }); var validationResult = new GoValidationResult() { IsValid = true }; goValidator.ValidateGo(game).Returns(validationResult); }
void GivenAllPlayersHaveTilesLeft() { var validationResult = new GoValidationResult() { IsValid = true }; goValidator.ValidateGo(game).Returns(validationResult); game.Players.ForEach(player => { player.Tiles.Add(new Tile()); }); }
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); }
void GivenAValidGoWhichHasCreatedSomeWords() { var validationResult = new GoValidationResult() { IsValid = true }; goValidator.ValidateGo(game).Returns(validationResult); goWords = new List <GoWord>() { new GoWord() { Word = "GOOD" }, new GoWord() { Word = "BETTER" } }; goWordFinder.FindWords().Returns(goWords); }
void GivenAValidGoWhichHasCreatedSomeInvalidWords() { var validationResult = new GoValidationResult() { IsValid = true }; goValidator.ValidateGo(game).Returns(validationResult); goWords = new List <GoWord>() { new GoWord() { Word = "BETTEREST" } }; goWordFinder.FindWords().Returns(goWords); var goWordValidatorResult = new GoValidationResult() { IsValid = false, Message = "BETTEREST is not a word" }; goWordValidator.ValidateWords(goWords).Returns(goWordValidatorResult); }
void WhenValidateGo() { result = validator.ValidateGo(validatable); }
public void GivenNoWords_ThenGoIsInvalid() { result = goWordValidator.ValidateWords(goWords); AssertGoIsInvalidWithMessage("No words were made!"); }