예제 #1
0
        void ThoughtsAndCrosses(string roomId, string userId)
        {
            var gameThoughtsAndCrosses = new GameThoughtsAndCrosses(_shuffleHelper);

            gameThoughtsAndCrosses.CalculateTopics();
            gameThoughtsAndCrosses.SetLetter();

            Rooms.RoomsList[roomId].SetThoughtsAndCrosses(gameThoughtsAndCrosses);
        }
예제 #2
0
        public void SetupNewThoughtsAndCrossesUser(string roomId, string userId, GameThoughtsAndCrosses game)
        {
            _joinRoomHelper.CreateRoom(userId, roomId);
            var userThoughtsAndCrosses = new UserThoughtsAndCrosses(_scoreHelper, _shuffleHelper);

            userThoughtsAndCrosses.CreateGrid(game.Topics.ChosenTopics);

            Rooms.RoomsList[roomId].Users[userId].SetUserThoughtsAndCrosses(userThoughtsAndCrosses);
        }
예제 #3
0
        public void ResetThoughtsAndCrosssesForUser(string roomId, string userId, GameThoughtsAndCrosses game)
        {
            var topics = Rooms.RoomsList[roomId].ThoughtsAndCrosses.Topics.ChosenTopics;

            Rooms.RoomsList[roomId].Users[userId].ThoughtsAndCrosses.CreateGrid(topics);
            var userThoughtsAndCrosses = new UserThoughtsAndCrosses(_scoreHelper, _shuffleHelper);

            userThoughtsAndCrosses.CreateGrid(game.Topics.ChosenTopics);

            Rooms.RoomsList[roomId].Users[userId].SetUserThoughtsAndCrosses(userThoughtsAndCrosses);
        }
예제 #4
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);
        }
        public void SetTopics()
        {
            _shuffleHelper
            .ShuffleList(Arg.Any <List <string> >())
            .Returns(new List <string> {
                "Girls name", "Boys name", "Book", "Fictional character", "Company / Brand", "Something outside", "Hobby", "Toy", "Electrical item", "Kitchen item", "Body part", "Colour", "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", "Fundraising Activity", "Drink", "Ice cream", "Artist", "Musical instrument", "Fundraising Activity"
            });

            var thoughtsAndCrosses = new GameThoughtsAndCrosses(_shuffleHelper);

            thoughtsAndCrosses.CalculateTopics();
            var topicsSet1 = thoughtsAndCrosses.Topics.ChosenTopics;

            thoughtsAndCrosses.CalculateTopics();
            var topicsSet2 = thoughtsAndCrosses.Topics.ChosenTopics;

            thoughtsAndCrosses
            .Topics
            .ChosenTopics
            .Should()
            .HaveCount(9);

            topicsSet1.Should().NotEqual(topicsSet2);
        }
        public void WhenLetterSetIsCalledLetterShouldHaveAValue()
        {
            _shuffleHelper
            .ShuffleList(Arg.Any <List <string> >())
            .Returns(new List <string> {
                "B", "A", "D", "C", "XYZ", "W", "V", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "G", "F", "E"
            });

            var thoughtsAndCrosses = new GameThoughtsAndCrosses(_shuffleHelper);

            thoughtsAndCrosses.SetLetter();
            var letter1 = thoughtsAndCrosses.Letter.Letter;

            thoughtsAndCrosses.SetLetter();
            var letter2 = thoughtsAndCrosses.Letter.Letter;

            thoughtsAndCrosses
            .Letter
            .Letter
            .Should()
            .NotBeNullOrWhiteSpace();

            letter1.Should().NotBeEquivalentTo(letter2);
        }
예제 #7
0
 public void ResetThoughtsAndCrosses(string roomId, GameThoughtsAndCrosses game)
 {
     Rooms.RoomsList[roomId].ThoughtsAndCrosses.SetLetter();
     Rooms.RoomsList[roomId].ThoughtsAndCrosses.CalculateTopics();
 }