public CreateGridTests()
        {
            _categoriesInitial = new List <string> {
                "Animal", "Colour", "Bird", "News", "Food", "Boat", "Plane", "Car", "Fruit"
            };
            _categoriesShuffled1 = new List <string> {
                "Food", "Fruit", "Colour", "Car", "Animal", "Plane", "Boat", "Bird", "News"
            };
            _categoriesShuffled2 = new List <string> {
                "Colour", "Fruit", "Boat", "Animal", "Plane", "Bird", "News", "Car", "Food"
            };

            _shuffleHelper = Substitute.For <IShuffleHelper <string> >();

            _shuffleHelper
            .ShuffleList(_categoriesShuffled1)
            .Returns(_categoriesShuffled1);

            _shuffleHelper
            .ShuffleList(_categoriesShuffled2)
            .Returns(_categoriesShuffled2);

            var scoreHelper = new ScoreHelper();

            _userThoughtsAndCrosses = new UserThoughtsAndCrosses(scoreHelper, _shuffleHelper);
        }
        public UncheckedWordTests()
        {
            _shuffleHelper     = Substitute.For <IShuffleHelper <string> >();
            _scoreHelper       = Substitute.For <IScoreHelper>();
            _categoriesInitial = new List <string> {
                "Animal", "Colour", "Bird", "News", "Food", "Boat", "Plane", "Car", "Fruit"
            };
            _categoriesShuffled = new List <string> {
                "Food", "Fruit", "Colour", "Car", "Animal", "Plane", "Boat", "Bird", "News"
            };

            _shuffleHelper = Substitute.For <IShuffleHelper <string> >();
            _shuffleHelper
            .ShuffleList(_categoriesInitial)
            .Returns(_categoriesShuffled);

            _userThoughtsAndCrosses = new UserThoughtsAndCrosses(_scoreHelper, _shuffleHelper);

            _userThoughtsAndCrosses.CreateGrid(_categoriesInitial);

            _userThoughtsAndCrosses.CheckWord("News");
            _userThoughtsAndCrosses.CheckWord("Food");
            _userThoughtsAndCrosses.CheckWord("Fruit");
            _userThoughtsAndCrosses.CheckWord("Bird");
            _userThoughtsAndCrosses.CheckWord("Car");
            _userThoughtsAndCrosses.CheckWord("Animal");
            _userThoughtsAndCrosses.CheckWord("Boat");
            _userThoughtsAndCrosses.CheckWord("Plane");
            _userThoughtsAndCrosses.CheckWord("Colour");
        }
Beispiel #3
0
 public TopicManager(IShuffleHelper <string> shuffleHelper)
 {
     _shuffleHelper = shuffleHelper;
     InitialTopics  = new List <string> {
         "Boys name", "Girls name", "Hobby", "Fictional character", "Something outside", "Book", "Electrical item", "Kitchen item", "Body part", "Song", "Something savoury", "Something sweet", "Colour", "Toy", "Movie", "Job / Occupation", "Sport / Game", "Place", "Food", "TV programme", "Transport", "Pet", "Actor / Actress", "Family member", "Holiday destination", "Weather", "Animal / Bird", "Something you make", "Drink", "Ice cream", "Artist", "Company / Brand", "Musical instrument", "Fundraising Activity"
     };
     InitialTopics = _shuffleHelper.ShuffleList(InitialTopics);
 }
Beispiel #4
0
 public GameManager(IJoinRoomHelper joinRoomHelper, IShuffleHelper <string> shuffleHelper, IScoreHelper scoreHelper, IFilenameHelper filenameHelper, IWordService wordService)
 {
     _joinRoomHelper = joinRoomHelper;
     _shuffleHelper  = shuffleHelper;
     _scoreHelper    = scoreHelper;
     _filenameHelper = filenameHelper;
     _wordService    = wordService;
 }
Beispiel #5
0
 public LetterManager(IShuffleHelper <string> shuffleHelper)
 {
     _shuffleHelper = shuffleHelper;
     Alphabet       = new List <string> {
         "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "XYZ"
     };
     Alphabet = _shuffleHelper.ShuffleList(Alphabet);
 }
Beispiel #6
0
 public GameBusi(IGameRepository gameRepository, IPlayerRepository playerRepository, IShuffleHelper shuffleHelper, IUpdater updater, IPlayerBusi playerBusi)
 {
     _gameRepository   = gameRepository;
     _playerRepository = playerRepository;
     _shuffleHelper    = shuffleHelper;
     _updater          = updater;
     _playerBusi       = playerBusi;
 }
Beispiel #7
0
        public void WhenMinutesAndSecondsSetTheTotalSecondsShouldBeReturned(int minutes, int seconds, int expectedTotal)
        {
            IShuffleHelper <string> shuffleHelper = Substitute.For <IShuffleHelper <string> >();
            var gameThoughtsAndCrosses            = new GameThoughtsAndCrosses(shuffleHelper);

            gameThoughtsAndCrosses.SetTimer(minutes, seconds);

            gameThoughtsAndCrosses
            .TimerSeconds
            .Should()
            .Be(expectedTotal);
        }
Beispiel #8
0
        public PixenaryManager(IShuffleHelper <string> shuffleStringHelper, IShuffleHelper <WordData> shuffleWordDataHelper, IWordCategoryHelper wordCategoryHelper, string roomId)
        {
            _shuffleStringHelper   = shuffleStringHelper;
            _wordCategoryHelper    = wordCategoryHelper;
            _shuffleWordDataHelper = shuffleWordDataHelper;
            Players = new List <string>();
            Grid    = new List <string>();

            WordsWithCategories = _wordCategoryHelper.GetAllWordsWithCategories();
            _shuffleWordDataHelper.ShuffleList(WordsWithCategories);

            var users = Rooms.RoomsList[roomId].Users;

            foreach (var player in users)
            {
                Players.Add(player.Key);
            }

            _shuffleStringHelper.ShuffleList(Players);
        }
        public void WhenCategoriesSelectedScoreShouldBeCalculatedCorrectly()
        {
            var scoreHelper = new ScoreHelper();

            var categories = new List <string> {
                "Animal", "Colour", "Bird", "News", "Food", "Boat", "Plane", "Car", "Fruit"
            };

            _shuffleHelper = Substitute.For <IShuffleHelper <string> >();
            _shuffleHelper
            .ShuffleList(categories)
            .Returns(categories);

            var userThoughtsAndCrosses = new UserThoughtsAndCrosses(scoreHelper, _shuffleHelper);

            userThoughtsAndCrosses.CreateGrid(categories);
            userThoughtsAndCrosses.CalculateScore();
            var initialScore = userThoughtsAndCrosses.Score;

            userThoughtsAndCrosses.CheckWord("Animal");
            userThoughtsAndCrosses.CheckWord("Bird");
            userThoughtsAndCrosses.CheckWord("Food");
            userThoughtsAndCrosses.CheckWord("Plane");
            userThoughtsAndCrosses.CheckWord("Fruit");

            userThoughtsAndCrosses.CalculateScore();
            var finalScore = userThoughtsAndCrosses.Score;

            initialScore
            .Should()
            .Be(0);

            finalScore
            .Should()
            .Be(11);
        }
 public GameThoughtsAndCrossesTests()
 {
     _shuffleHelper = Substitute.For <IShuffleHelper <string> >();
 }
Beispiel #11
0
 public GameThoughtsAndCrosses(IShuffleHelper <string> shuffleHelper)
 {
     _shuffleHelper = shuffleHelper;
     Letter         = new LetterManager(_shuffleHelper);
     Topics         = new TopicManager(_shuffleHelper);
 }