public void Test_HowManyDuplicates() { int[] dups = { 1, 3, 5, 1, 4, 5, 2, 4, 3, 5, 3, 1 }; string expected = "1 -> 3x \n" + "2 -> 1x \n" + "3 -> 3x \n" + "4 -> 2x \n" + "5 -> 3x \n"; Assert.Equal(expected, HowManyDuplicates.duplicate(dups)); }
public void Duplicates() { int[] dups = { 1, 3, 5, 1, 4, 5, 2, 4, 3, 5, 3, 1 }; string hasil = "1 -> 3x \n" + "2 -> 1x \n" + "3 -> 3x \n" + "4 -> 2x \n" + "5 -> 3x \n"; Assert.Equal(hasil, HowManyDuplicates.duplicate(dups)); }