コード例 #1
0
        static void Codility()
        {
            //            // Counting Elements
            //            var frogJumps = new FrogJumps();
            //            frogJumps.Solution();
            //
            //            var countingOperations = new CountingOperations();
            //            countingOperations.Solution();

            //            var missingInteger = new MissingInteger();
            //            missingInteger.Solution();

            //            var countDiv = new CountDiv();
            //            countDiv.Solution();

            //            var genomicRangeQuery = new GenomicRangeQuery();
            //            genomicRangeQuery.Solution();

            //var passingCars = new PassingCars();
            //passingCars.Solution();

            //var sorting = new MaxProductOfThree();
            //sorting.Solution();

            var numberOfDiscIntersections = new NumberOfDiscIntersections();

            numberOfDiscIntersections.Solution(new[] { 1, 5, 2, 1, 4, 0 });
        }
コード例 #2
0
        public void Solution_SmallArray_Correct()
        {
            //Arrange - Given
            var array = new int[] { 1, 5, 2, 1, 4, 0 };

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

            //Assert - Then
            var expectedResult = 11;

            Assert.Equal(expectedResult, result);
        }