Пример #1
0
        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]);
        }
Пример #2
0
        public void Draw_ReturnsLosers()
        {
            // Arrange
            var drawService = new DrawService();

            drawService.AddParticipant("participant_one");
            drawService.AddParticipant("participant_two");
            drawService.AddParticipant("participant_three");

            // Act
            var winner = drawService.Draw();

            drawService.RemoveParticipant(winner);

            // Assert
            Assert.Contains(drawService.GetParticipants(), _ => !_.Contains(winner));
        }