Exemplo n.º 1
0
        public void TestAddCeleb()
        {
            Game  newGame = GameAPI.CreateGame("New Game");
            Celeb celeb   = GameAPI.AddCelebToGame(new Celeb()
            {
                Name = "Name 1", GameId = newGame.Id
            }, newGame);
            Celeb celeb2 = GameAPI.AddCelebToGame(new Celeb()
            {
                Name = "Name 2", GameId = newGame.Id
            }, newGame);

            Game gameRetrieved = GameAPI.GetGameById(newGame.Id);

            gameRetrieved.Celebs.Should().HaveCount(2);
            gameRetrieved.Celebs.Should().ContainEquivalentOf(celeb);
            gameRetrieved.Celebs.Should().ContainEquivalentOf(celeb2);
        }
Exemplo n.º 2
0
        public void TestCelebGuessed()
        {
            Game  newGame = GameAPI.CreateGame("New Game");
            Celeb celeb   = GameAPI.AddCelebToGame(new Celeb()
            {
                Name = "Name 1", GameId = newGame.Id
            }, newGame);
            Celeb celeb2 = GameAPI.AddCelebToGame(new Celeb()
            {
                Name = "Name 2", GameId = newGame.Id
            }, newGame);
            Celeb celeb3 = GameAPI.AddCelebToGame(new Celeb()
            {
                Name = "Name 3", GameId = newGame.Id
            }, newGame);

            celeb2.Guess();

            GameAPI.UpdateCeleb(celeb2);

            Celeb retrievedCeleb = GameAPI.GetCeleb(celeb2.Id);

            retrievedCeleb.State.Should().Be(CelebState.GUESSED);
        }