Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Correct the following code To meet the specified requirements in the comments. Note: the TakingTurnsQueue.cs file should not be edited public static class TakingTurns {
Correct the following code
To meet the specified requirements in the comments. Note: the TakingTurnsQueue.cs file should not be edited
public static class TakingTurns
public static void Test
TODO Problem Run test cases and fix the code to match requirements
Test Cases
Test
Scenario: Create a queue with the following people and turns: Bob Tim Sue and
run until the queue is empty
Expected Result: Bob, Tim, Sue, Bob, Tim, Sue, Tim, Sue, Tim, Tim
Console.WriteLineTest ;
var players new TakingTurnsQueue;
players.AddPersonBob;
players.AddPersonTim;
players.AddPersonSue;
Console.WriteLineplayers; This can be uncommented out for debug help
while playersLength
players.GetNextPerson;
Defects Found: mishandling of the players. players did not display in expected order.
Console.WriteLine;
Test
Scenario: Create a queue with the following people and turns: Bob Tim Sue
After running times, add George with turns. Run until the queue is empty.
Expected Result: Bob, Tim, Sue, Bob, Tim, Sue, Tim, George, Sue, Tim, George, Tim, George
Console.WriteLineTest ;
players new TakingTurnsQueue;
players.AddPersonBob;
players.AddPersonTim;
players.AddPersonSue;
for int i ; i ; i
players.GetNextPerson;
Console.WriteLineplayers;
players.AddPersonGeorge;
Console.WriteLineplayers;
while playersLength
players.GetNextPerson;
Defects Found:
Console.WriteLine;
Test
Scenario: Create a queue with the following people and turns: Bob Tim Forever Sue
Run times.
Expected Result: Bob, Tim, Sue, Bob, Tim, Sue, Tim, Sue, Tim, Tim
Console.WriteLineTest ;
players new TakingTurnsQueue;
players.AddPersonBob;
players.AddPersonTim;
players.AddPersonSue;
Console.WriteLineplayers;
for int i ; i ; i
players.GetNextPerson;
Console.WriteLineplayers;
Defects Found:
Console.WriteLine;
Test
Scenario: Create a queue with the following people and turns: Tim Forever Sue
Run times.
Expected Result: Tim, Sue, Tim, Sue, Tim, Sue, Tim, Tim, Tim, Tim
Console.WriteLineTest ;
players new TakingTurnsQueue;
players.AddPersonTim;
players.AddPersonSue;
Console.WriteLineplayers;
for int i ; i ; i
players.GetNextPerson;
Console.WriteLineplayers;
Defects Found:
Console.WriteLine;
Test
Scenario: Try to get the next person from an empty queue
Expected Result: Error message should be displayed
Console.WriteLineTest ;
players new TakingTurnsQueue;
players.GetNextPerson;
Defects Found:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started