Exemple #1
0
        public void ValidateHop_should_return_true()
        {
            // Arrange
            HopArrivalModel hop = new HopArrivalModel()
            {
                Code = "MOCK", TrackingId = "MOCKCODE", DateTime = DateTime.Now
            };

            // Act
            var result = _tl.ValidateHop(hop);

            // Assert
            Assert.IsTrue(result);
        }
Exemple #2
0
        public bool ReportParcelHop(string parcelTrackingCode, string locationCode)
        {
            try
            {
                // i.   Validation of data
                HopArrivalModel hop = new HopArrivalModel()
                {
                    TrackingId = parcelTrackingCode, Code = locationCode, DateTime = DateTime.Now
                };
                _trackingLogic.ValidateHop(hop);

                // ii.  Write new hop for parcel journey to DB
                return(_trackingLogic.ReportHop(hop));
            }
            catch (Exception ex)
            {
                throw new BLException("BL error reporting hop: " + ex.Message, ex);
            }
        }