public void isWinReturnsFalseWhenContestantLose() { Monty game = new Monty(2); game.PickDoor(Array.IndexOf(game.Doors, game.Doors.Single(d => d.ContainsPrize == false))); Assert.False(game.IsWin()); }
public void isWinReturnsTrueWhenContestantWins() { Monty game = new Monty(2); game.PickDoor(Array.IndexOf(game.Doors, game.Doors.Single(d => d.ContainsPrize == true))); Assert.True(game.IsWin()); }
public void ContestantCanPickDoor() { Monty game = new Monty(3); int doorToPick = 0; game.PickDoor(doorToPick); Assert.True(game.Doors[doorToPick].Picked == true); }
public void HostRevealsDoorWhenMultipleToReveal() { Monty game = new Monty(10, mockRandom); int doorToPick = 0; game.PickDoor(doorToPick); game.RevealDoors(); Assert.True(game.Doors.Where(d => d.Revealed).Count() == 8); }
public void HostRevealsDoorWhenDudPicked() { Monty game = new Monty(3, mockRandom); int doorToPick = 1; game.PickDoor(doorToPick); game.RevealDoors(); Assert.True(game.Doors.Where(d => d.Revealed == true).Count() == 1); }
public void ContestantCanSwitchDoorWhenDudPicked() { Monty game = new Monty(3, mockRandom); Door firstDoorToPick = game.Doors[1]; game.PickDoor(1); Assert.True(game.Doors[1].Picked == true); game.RevealDoors(); Door secondDoorToPick = game.Doors.Single(d => d.Picked == false && d.Revealed == false); game.SwitchDoor(); Assert.True(game.Doors.Where(d => d.Picked).Count() == 1); Assert.False(firstDoorToPick == secondDoorToPick); }