public void test_solution_givenArrayOfInterer_returnsNumberOfDistinctElements(int[] given, int expected) { var target = new Distinct(); var actual = target.solution(given); Assert.AreEqual(expected, actual); }
public void Distinct_Should_Hanlde_Empty_Array() { Distinct subject = new Distinct(); int[] array = { }; int result = subject.solution(array); Assert.Equal(0, result); }
public void Distinct_Should_Process_Simple_Array() { Distinct subject = new Distinct(); int[] array = { 2, 1, 1, 2, 3, 1 }; int result = subject.solution(array); Assert.Equal(3, result); }
public void Distinct_Should_Process_Complex_Array() { Distinct subject = new Distinct(); int[] array = { 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 3, 1, 2, 1, 1, 2, 3, 1, 5, 7, 8, 3, 2, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 6, 7 }; int result = subject.solution(array); Assert.Equal(10, result); }
public void Case01() { // Arrange var algorithm = new Distinct(); var A = new int[] { 2, 1, 1, 2, 3, 1 }; // Act var result = algorithm.solution(A); var expected = 3; // Assert Assert.Equal(expected, result); }
public void DistinctTest_01() { var solution = dst.solution(new int[] { 2, 1, 1, 2, 3, 1 }); Assert.AreEqual(3, solution); }