Example #1
0
        public void ConvertCreatesNewToc()
        {
            var schedule = TestSchedules.CreateScheduleExtraDetails(toc: "SW");

            var output = MapSchedule(schedule);

            Assert.Equal("SW", output.Operator.Code);
        }
Example #2
0
        public void ConvertUsesExistingToc()
        {
            var schedule = TestSchedules.CreateScheduleExtraDetails(toc: "VT");

            var output = MapSchedule(schedule);

            Assert.Same(VT, output.Operator);
        }
Example #3
0
        public void ThrowsExceptionIfDoNotPassTocs()
        {
            var schedule = TestSchedules.CreateScheduleExtraDetails();
            var mapper   = _fromCifProfileConfiguration.CreateMapper();

            var ex = Assert.Throws <AutoMapperMappingException>(() => mapper.Map <CifParser.Records.ScheduleExtraData, Timetable.CifSchedule>(schedule, new CifSchedule()));

            Assert.IsType <ArgumentException>(ex.InnerException);
        }