public void TestCelebGuessedGoesToCorrectState() { Celeb celeb = new Celeb("Danny Dyer"); celeb.Guess(); celeb.State.Should().Be(CelebState.GUESSED); }
public void TestCelebGuessedWhenStateInvalid() { Celeb celeb = new Celeb("Danny Dyer"); celeb.Guess(); celeb.Invoking(c => c.Guess()) .Should().Throw <InvalidOperationException>(); }
public void CelebGuessed(int celebId) { Celeb celeb = _context.Celeb.Single(c => c.Id == celebId); celeb.Guess(); _context.Celeb.Update(celeb); _context.SaveChanges(); }
public void TestGameStateCelebGuessedGame() { Game game = new Game(); var geezer = new Celeb("Danny Dyer"); game.AddCeleb(geezer); game.AddCeleb(new Celeb("Geoff Capes")); game.State.Should().Be(RoundState.ROUND_READY_TO_START); geezer.Guess(); game.State.Should().Be(RoundState.ROUND_IN_PROGRESS); }
public void TestGameStateAllCelebsGuessedGame() { Game game = new Game(); var geezer = new Celeb("Danny Dyer"); game.AddCeleb(geezer); var geoff = new Celeb("Geoff Capes"); game.AddCeleb(geoff); game.State.Should().Be(RoundState.ROUND_READY_TO_START); geezer.Guess(); geoff.Guess(); game.State.Should().Be(RoundState.ROUND_COMPLETE); }
public void TestGetNullBackIfNoneInHat() { Game game = new Game(); var geezer = new Celeb("Danny Dyer"); game.AddCeleb(geezer); var geoff = new Celeb("Geoff Capes"); game.AddCeleb(geoff); geezer.Guess(); geoff.Burn(); game.GetRandomCelebFromHat().Should().BeNull(); }
public void TestGetRandomCeleb() { Game game = new Game(); var geezer = new Celeb("Danny Dyer"); game.AddCeleb(geezer); var geoff = new Celeb("Geoff Capes"); game.AddCeleb(geoff); var john = new Celeb("John Peel"); game.AddCeleb(john); var bill = new Celeb("Bill Bailey"); game.AddCeleb(bill); var jake = new Celeb("Jake Gyllenhaal"); game.AddCeleb(jake); geezer.Guess(); geoff.Guess(); john.Guess(); jake.Guess(); game.GetRandomCelebFromHat().Should().Be(bill); }
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); }