Example #1
0
        public void Should_print_the_total_cost_for_passages()
        {
            var input = (Environment.CurrentDirectory + "../../../../mockTestData.txt");
            var sw    = new StringWriter();

            Console.SetOut(sw);
            Calculator.Run(input);
            Assert.AreEqual("The total fee for the inputfile is 29", sw.ToString());
        }
Example #2
0
        public void Should_throw_expected_exception_If_input_data_cannot_be_parsed()
        {
            var input = (Environment.CurrentDirectory + "../../../../mockInvalidPassageTestData.txt");

            Assert.ThrowsException <FormatException>(() => Calculator.Run(input));
        }
Example #3
0
        public void Should_throw_expected_exception_If_input_data_contains_multiple_dates()
        {
            var input = (Environment.CurrentDirectory + "../../../../mockMultipleDatesTestData.txt");

            Assert.ThrowsException <ArgumentException>(() => Calculator.Run(input));
        }