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 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); }
private void DoGoWordValidation() { wordValidationResult = goWordValidator.ValidateWords(goWords); }