public void SampleTest2() { String actual = ValidTeamsAndNames.Validate("W:John,John,John,JohnC:Danger,Man"); String expected = "2:John,John,John,John,Danger,Man"; Assert.AreEqual(expected, actual); }
public void RandomTests() { for (int i = 0; i < 100; i++) { StringBuilder sb = new StringBuilder(); char[] shuffled = Shuffle(alphabet); int teams = random.Next(26); int guaranteedTeam = random.Next(teams + 1); for (int j = teams; j >= 0; j--) { sb.Append(shuffled[j]); sb.Append(':'); for (int k = random.Next(5) + (j == guaranteedTeam ? 1 : 0); k >= 0; k--) { sb.Append(names[random.Next(names.Length)]); if (k > 0) { sb.Append(','); } } } string s = sb.ToString(); Assert.AreEqual(Solutions.ValidTeamsAndNames.Validate(s), ValidTeamsAndNames.Validate(s)); } }
public void SampleTest1() { String actual = ValidTeamsAndNames.Validate("A:Stefan,Milica,Zvonimir,AndrewH:Richard"); String expected = "1:Stefan,Milica,Zvonimir,Andrew"; Assert.AreEqual(expected, actual); }