Exemple #1
0
        public void MapAssociationWhereMainServiceDoesNotHaveLocation(bool isCancelled)
        {
            var mapper = ToViewProfileConfiguration.CreateMapper();

            var newStops = TestSchedules.DefaultLocations
                           .Where(l => !l.Station.Equals(TestStations.ClaphamJunction))
                           .ToArray();

            var mainService = TestSchedules.CreateService(stops: newStops);
            var resolved    = TestSchedules.CreateServiceWithAssociation(mainService, isCancelled);

            var output =
                mapper.Map <Timetable.ResolvedService, Model.Service>(resolved, opts => opts.Items["On"] = resolved.On);

            Assert.True(output.Associations[0].IsBroken);
            Assert.Null(output.Associations[0].Stop);
            Assert.Equal(isCancelled, output.Associations[0].IsCancelled);
        }