public void Setup() { mocks = new MockRepository(); _postUtil = mocks.CreateMock<IWebPoster>(); _dt = new DhlTracker(_postUtil, "user", "pass"); }
public void Setup() { mocks = new MockRepository(); _postUtil = mocks.CreateMock <IWebPoster>(); _dt = new DhlTracker(_postUtil, "user", "pass"); }
/// <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)); }
public void Valid_11_Digit_Tracking_Number() { Assert.IsTrue(DhlTracker.IsValidTrackingNumber("12991078030")); }
public void Valid_10_Digit_Tracking_Number() { //Not sure if this is ACTUALLY valid, but the length is right Assert.IsTrue(DhlTracker.IsValidTrackingNumber("1299107803")); }
public void Tracking_Number_Too_Short_Verify_Invalid() { Assert.IsFalse(DhlTracker.IsValidTrackingNumber("129910788")); }