public void Solution_SmallArray_Correct()
        {
            //Arrange - Given
            var array = new int[] { 2, 1, 1, 2, 3, 1 };

            //Act - When
            var result = Distinct.Solution(array);

            //Assert - Then
            var expectedResult = 3;

            Assert.Equal(expectedResult, result);
        }
예제 #2
0
        public void SolutionEmptyTest()
        {
            // Arrange
            int[] A = new int[] { };

            // Action
            int actual = Distinct.Solution(A);

            // Assert
            int expected = 0;

            Assert.AreEqual(expected, actual);
        }
예제 #3
0
        public void SolutionSimpleTwoValuesTest()
        {
            // Arrange
            int[] A = new int[] { 2, 2 };

            // Action
            int actual = Distinct.Solution(A);

            // Assert
            int expected = 1;

            Assert.AreEqual(expected, actual);
        }
예제 #4
0
        public void SolutionSimpleTest()
        {
            // Arrange
            int[] A = new int[] { 2, 1, 1, 2, 3, 1 };

            // Action
            int actual = Distinct.Solution(A);

            // Assert
            int expected = 3;

            Assert.AreEqual(expected, actual);
        }
예제 #5
0
        public void TestBasicCase()
        {
            //Given
            var baseCaseArray  = new int[] { 2, 1, 1, 2, 3, 1 };
            var distinct       = new Distinct();
            var expectedResult = 3;

            //When
            var actualResult = distinct.Solution(baseCaseArray);

            //Then
            Assert.AreEqual(expectedResult, actualResult);
        }
 public void EnumberableTest()
 {
     Assert.AreEqual(50, Distinct.Solution(Enumerable.Range(-25, 50).ToArray()));
 }
 public void AllZeroTest()
 {
     Assert.AreEqual(1, Distinct.Solution(new int[1000]));
 }
 public void ExampleTest()
 {
     Assert.AreEqual(3, Distinct.Solution(new [] { 2, 1, 1, 2, 3, 1 }));
 }