public void GetParticipantsCount_AllParticipants_ReturnsCountOfParticipants() { // Arrange var drawService = new DrawService(); drawService.AddParticipant("participant_one"); drawService.AddParticipant("participant_two"); drawService.AddParticipant("participant_three"); // Act var result = drawService.GetParticipantsCount(); // Assert Assert.Equal(3, result); }
public void RemoveAllParticipants_ReturnsNoParticipants() { // Arrange var drawService = new DrawService(); drawService.AddParticipant("participant_one"); drawService.AddParticipant("participant_two"); drawService.AddParticipant("participant_three"); // Act drawService.RemoveAllParticipants(); // Assert Assert.Equal(0, drawService.GetParticipants().Count); }
public void Draw_ReturnsWinner() { // Arrange var drawService = new DrawService(); drawService.AddParticipant("participant_one"); drawService.AddParticipant("participant_two"); drawService.AddParticipant("participant_three"); // Act var winner = drawService.Draw(); // Assert Assert.Contains(drawService.GetParticipants(), _ => _.Contains(winner)); }
public void RemoveParticipant_SingleParticipant_ReturnsParticipantNotRemoved() { // Arrange var drawService = new DrawService(); var toRemove = "participant_one"; var expected = "participant_two"; drawService.AddParticipant(toRemove); drawService.AddParticipant(expected); // Act drawService.RemoveParticipant(toRemove); // Assert Assert.Equal(expected, drawService.GetParticipants()[0]); }
public void AddParticipant_SingleParticipant_ReturnsParticipantAdded() { // Arrange var drawService = new DrawService(); // Act var expected = "participant_one"; drawService.AddParticipant(expected); // Assert Assert.Equal(expected, drawService.GetParticipants()[0]); }