示例#1
0
        private Association CreateJoinServices()
        {
            var main       = TestSchedules.CreateScheduleWithService("X12345", retailServiceId: "VT123401").Service;
            var associated = TestSchedules.CreateScheduleWithService("A98765", retailServiceId: "VT123402",
                                                                     stops: TestSchedules.CreateWokingClaphamSchedule(TestSchedules.NineForty)).Service;
            var association = TestAssociations.CreateAssociationWithServices(main, associated);

            return(association);
        }
        private Association CreateJoinServices(ScheduleLocation[] mainStops = null)
        {
            mainStops = mainStops ?? TestSchedules.CreateThreeStopSchedule(TestSchedules.Ten);
            var main       = TestSchedules.CreateScheduleWithService("X12345", retailServiceId: "VT123401", stops: mainStops).Service;
            var associated = TestSchedules.CreateScheduleWithService("A98765", retailServiceId: "VT123402",
                                                                     stops: TestSchedules.CreateWokingClaphamSchedule(TestSchedules.NineForty)).Service;
            var association = TestAssociations.CreateAssociationWithServices(main, associated);

            return(association);
        }
示例#3
0
        private Association CreateJoinServices(Time associationDeparts, ScheduleLocation[] mainStops = null)
        {
            mainStops ??= CreateMainStops();
            var main       = TestSchedules.CreateScheduleWithService("X12345", retailServiceId: "VT123401", stops: mainStops).Service;
            var associated = TestSchedules.CreateScheduleWithService("A98765", retailServiceId: "VT123402",
                                                                     stops: TestSchedules.CreateWokingClaphamSchedule(associationDeparts)).Service;
            var association = TestAssociations.CreateAssociationWithServices(main, associated);

            return(association);
        }
示例#4
0
        public void RemoveAssociationWithCancelledService()
        {
            var main         = TestSchedules.CreateService();
            var associated   = TestSchedules.CreateService("X98765", stops: TestSchedules.CreateWokingClaphamSchedule(TestSchedules.NineForty), isCancelled: true);
            var association1 = TestSchedules.CreateAssociation(main, associated);
            var association2 = TestSchedules.CreateAssociation(main, "X56789");

            var withAssociation = new ResolvedServiceWithAssociations(main, new [] { association1, association2 });

            withAssociation.RemoveCancelledAssociations();

            Assert.Single(withAssociation.Associations);
            Assert.Equal(association2, withAssociation.Associations[0]);
        }
        public static ScheduleLocation[] CreateAssociateStopsSettingClaphamActivities(AssociationCategory joinSplit, string activities)
        {
            ScheduleLocation[] stops;

            if (joinSplit.IsJoin())
            {
                stops = TestSchedules.CreateWokingClaphamSchedule(TestSchedules.NineForty);
                stops[2].Activities = new Activities(activities);
            }
            else
            {
                stops = TestSchedules.CreateClaphamWokingSchedule(TestSchedules.TenTwentyFive);
                stops[0].Activities = new Activities(activities);
            }

            return(stops);
        }