Пример #1
0
        public ResetGameTests()
        {
            var room = new Room();

            room.AddUser("Joshua");
            room.AddUser("Lydia");

            var roomName = Guid.NewGuid().ToString();

            Rooms.RoomsList.Add(roomName, room);


            var wordList = new List <WordData>
            {
                new WordData {
                    Word = "Sheep", Category = WordCategory.Animal
                },
                new WordData {
                    Word = "Plane", Category = WordCategory.Vehicle
                },
                new WordData {
                    Word = "Snowdrop", Category = WordCategory.Plant
                }
            };

            var shuffleStringHelper = Substitute.For <IShuffleHelper <string> >();

            shuffleStringHelper
            .ShuffleList(Arg.Any <List <string> >())
            .Returns(new List <string> {
                "Joshua", "Lydia"
            });

            var shuffleWordHelper = Substitute.For <IShuffleHelper <WordData> >();

            shuffleWordHelper
            .ShuffleList(Arg.Any <List <WordData> >())
            .Returns(wordList);

            var wordCategoryHelper = Substitute.For <IWordCategoryHelper>();

            wordCategoryHelper.GetAllWordsWithCategories().Returns(wordList);

            _pixenaryManager = new PixenaryManager(shuffleStringHelper, shuffleWordHelper, wordCategoryHelper, roomName);

            _pixenaryManager.ChooseActivePlayer();
            _pixenaryManager.ChooseWord();
            _pixenaryManager.CreateNewList(10);
            _pixenaryManager.UpdatePixel(10, "#ff0000");
        }
Пример #2
0
 public void WhenChooseWordIsCalledANewWordShouldBeSet()
 {
     _pixenaryManager.ChooseWord();
     _wordList.Should().ContainEquivalentOf(_pixenaryManager.Word);
     _pixenaryManager.Word.Should().BeEquivalentTo(_wordList[0]);
 }