示例#1
0
        public void Setup()
        {
            mocks = new MockRepository();
            _postUtil = mocks.CreateMock<IWebPoster>();

            _dt = new DhlTracker(_postUtil, "user", "pass");
        }
示例#2
0
        public void Setup()
        {
            mocks     = new MockRepository();
            _postUtil = mocks.CreateMock <IWebPoster>();

            _dt = new DhlTracker(_postUtil, "user", "pass");
        }
示例#3
0
        /// <summary>
        ///		Gets the DHL tracking details for a tracking number.
        /// </summary>
        /// <param name="trackingNumber">
        ///		The tracking number to retrieve tracking details for.
        /// </param>
        /// <returns>
        ///		The tracking data extracted from the tracking response.
        /// </returns>
        public TrackingData GetTrackingData(string trackingNumber)
        {
            if (!DhlTracker.IsValidTrackingNumber(trackingNumber))
            {
                return(null);
            }

            string requestString = string.Format("txtTrackNbrs={0}", trackingNumber);
            string responseXml   = _postUtility.PostData(POST_URL, requestString);

            return(ScreenScrapeResponse.GetCommonTrackingData(responseXml));
        }
示例#4
0
 public void Valid_11_Digit_Tracking_Number()
 {
     Assert.IsTrue(DhlTracker.IsValidTrackingNumber("12991078030"));
 }
示例#5
0
 public void Valid_10_Digit_Tracking_Number()
 {
     //Not sure if this is ACTUALLY valid, but the length is right
     Assert.IsTrue(DhlTracker.IsValidTrackingNumber("1299107803"));
 }
示例#6
0
 public void Tracking_Number_Too_Short_Verify_Invalid()
 {
     Assert.IsFalse(DhlTracker.IsValidTrackingNumber("129910788"));
 }