public void test_solution_givenNonEmptyArray_returnsTheNumberOfPairs(int[] given, int expected)
        {
            var target = new PassingCars();
            int actual = target.solution(given);

            Assert.AreEqual(expected, actual);
        }
Esempio n. 2
0
        public void PassingSars_Should_Process_Simple_Array()
        {
            PassingCars subject = new PassingCars();

            int[] array  = { 0, 1, 0, 1, 1 };
            int   result = subject.solution(array);

            Assert.Equal(5, result);
        }
Esempio n. 3
0
        public void PassingCars_Should_Process_West_Only_Array()
        {
            PassingCars subject = new PassingCars();

            int[] array  = { 1, 1, 1, 1, 1 };
            int   result = subject.solution(array);

            Assert.Equal(0, result);
        }
Esempio n. 4
0
        public void Case01()
        {
            // Arrange
            var A         = new int[] { 0, 1, 0, 1, 1 };
            var algorithm = new PassingCars();

            // Act
            int result = algorithm.solution(A);

            // Assert
            int expected = 5;

            Assert.Equal(expected, result);
        }
Esempio n. 5
0
 public void PassingCars()
 {
     int[] cars = new int[] { 0, 1, 0, 1, 1 };
     Assert.IsTrue(pc.solution(cars) == 5);
 }
Esempio n. 6
0
        public void PassingCarsTest()
        {
            var solution = pc.solution(new int[] { 0, 1, 0, 1, 1 });

            Assert.AreEqual(5, solution);
        }
        private void Test(int[] a, int expectedResult)
        {
            var result = _passingCars.solution(a);

            Assert.AreEqual(expectedResult, result);
        }