예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
 private void DoGoWordValidation()
 {
     wordValidationResult = goWordValidator.ValidateWords(goWords);
 }