public void Execute_InvalidArguments_ThrowsException(char source, char destination)
        {
            var graph      = new Graph <char>();
            var exactStops = 4;
            var calculator = new ExactStopsRoutesCalculator <char>(graph, exactStops);

            var result = calculator.Execute(source, destination);
        }
        public void Execute_SourceNotExists_DefaultResult()
        {
            var graph      = new Graph <char>();
            var exactStops = 4;
            var calculator = new ExactStopsRoutesCalculator <char>(graph, exactStops);

            var source         = 'A';
            var destination    = 'C';
            var expectedResult = 0;

            var result = calculator.Execute(source, destination);

            Assert.AreEqual(expectedResult, result);
        }
        public void Execute_SameSourceAndDestination_CorrectResult()
        {
            var graph      = TestUtils.BuildDefaultTestGraph();
            var exactStops = 4;
            var calculator = new ExactStopsRoutesCalculator <char>(graph, exactStops);

            var source         = 'C';
            var destination    = 'C';
            var expectedResult = 2;

            var result = calculator.Execute(source, destination);

            Assert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 4
0
        private void RunTestCase7(Graph <char> graph)
        {
            var result = new ExactStopsRoutesCalculator <char>(graph, exactStops: 4).Execute('A', 'C');

            OutputResult(7, result);
        }