public void returns_expected_result()
        {
            var recordParser = BuildParser();
            var recordToParse = "LOSDON    1242 12422         TB                                                 ";
            var expectedResult = new ScheduleLocationRecord
            {
                RecordIdentity = ScheduleRecordType.LO,
                Tiploc = "SDON",
                WorkingDeparture = "1242",
                PublicDeparture = "1242",
                Platform = "2",
                LocationActivity = LocationActivity.TB,
                LocationActivityString = "TB          ",
                OrderTime = "1242"
            };

            var result = recordParser.ParseRecord(recordToParse);

            Assert.AreEqual(expectedResult, result);
        }
        public void returns_expected_result()
        {
            var recordParser = BuildParser();
            var recordToParse = "LTWSTBRYW 1323 13253     TF                                                     ";
            var expectedResult = new ScheduleLocationRecord
            {
                RecordIdentity = ScheduleRecordType.LT,
                Tiploc = "WSTBRYW",
                WorkingArrival = "1323",
                PublicArrival = "1325",
                Platform = "3",
                LocationActivity = LocationActivity.TF,
                LocationActivityString = "TF          ",
                OrderTime = "1323"
            };

            var result = recordParser.ParseRecord(recordToParse);

            Assert.AreEqual(expectedResult, result);
        }
        public void returns_expected_result_pass()
        {
            var recordParser = BuildParser();
            var recordToParse = "LIBRDFDJN           1314 00000000                                               ";
            var expectedResult = new ScheduleLocationRecord
            {
                RecordIdentity = ScheduleRecordType.LI,
                Tiploc = "BRDFDJN",
                Pass = "******",
                OrderTime = "1314",
                LocationActivityString = "            ",
                PublicArrival = string.Empty,
                PublicDeparture = string.Empty,
                WorkingDeparture = string.Empty,
                WorkingArrival = string.Empty
            };

            var result = recordParser.ParseRecord(recordToParse);

            Assert.AreEqual(expectedResult, result);
        }
Ejemplo n.º 4
0
 protected bool Equals(ScheduleLocationRecord other)
 {
     return(Id == other.Id &&
            EngineeringAllowance.Equals(other.EngineeringAllowance) &&
            string.Equals(Line, other.Line) &&
            LocationActivity == other.LocationActivity &&
            string.Equals(LocationActivityString, other.LocationActivityString) &&
            string.Equals(OrderTime, other.OrderTime) &&
            string.Equals(Pass, other.Pass) &&
            string.Equals(Path, other.Path) &&
            PathingAllowance.Equals(other.PathingAllowance) &&
            PerformanceAllowance.Equals(other.PerformanceAllowance) &&
            string.Equals(Platform, other.Platform) &&
            string.Equals(PublicArrival, other.PublicArrival) &&
            string.Equals(PublicDeparture, other.PublicDeparture) &&
            RecordIdentity == other.RecordIdentity &&
            string.Equals(Tiploc, other.Tiploc) &&
            string.Equals(TiplocSuffix, other.TiplocSuffix) &&
            string.Equals(WorkingArrival, other.WorkingArrival) &&
            string.Equals(WorkingDeparture, other.WorkingDeparture));
 }
        public void returns_expected_result_arrival_and_departure()
        {
            var recordParser = BuildParser();
            var recordToParse = "LIMELKSHM 1307H1308      13081308         T                                     ";
            var expectedResult = new ScheduleLocationRecord
            {
                RecordIdentity = ScheduleRecordType.LI,
                Tiploc = "MELKSHM",
                WorkingArrival = "1307H",
                PublicArrival = "1308",
                WorkingDeparture = "1308",
                PublicDeparture = "1308",
                LocationActivity = LocationActivity.T,
                LocationActivityString = "T           ",
                OrderTime = "1308",
                Pass = string.Empty
            };

            var result = recordParser.ParseRecord(recordToParse);

            Assert.AreEqual(expectedResult, result);
        }