Beispiel #1
0
        public void AssertThatSolutionReturnsTheValueOfTheUnpairedElement(int[] given, int expected)
        {
            var target = new OddOccurrencesInArray();
            var actual = target.solution(given);

            Assert.AreEqual(expected, actual);
        }
Beispiel #2
0
        public void OddOccurrencesInArrayTest()
        {
            Console.WriteLine("Start");

            // Random r = new Random(DateTime.Now.Millisecond);

            Assert.AreEqual(OddOccurrencesInArray.solution(new int[] { 9, 3, 9, 3, 9, 7, 9 }), 7);
        }
Beispiel #3
0
        public void OddOccurrencesInArrayTest1()
        {
            OddOccurrencesInArray ooia = new OddOccurrencesInArray();

            long[] array  = { 9, 3, 9, 3, 9, 7, 9 };
            long   result = ooia.solution(array);

            Assert.Equal(7, result);
        }
        public void OddOccurencesInArrayTest_01()
        {
            OddOccurrencesInArray or = new OddOccurrencesInArray();

            int[] array    = new int[] { 3, 1, 2, 2, 3 };
            var   solution = or.solution(array);

            Assert.AreEqual(1, solution);
        }
Beispiel #5
0
        public void Case1()
        {
            // Arrange
            var arrayInput = new int[] { 9, 3, 9, 3, 9, 7, 9 };
            var algorithm  = new OddOccurrencesInArray();

            // Act
            var result = algorithm.solution(arrayInput);

            // Assert
            var expected = 7;

            Assert.Equal(expected, result);
        }
Beispiel #6
0
        private void Test(int[] array, int expectedResult)
        {
            var result = _oddOccurrencesInArray.solution(array);

            Assert.AreEqual(expectedResult, result);
        }