Exemplo n.º 1
0
        public void Test_Dev_Url_Request_Response_Process()
        {
            _tracker = new UspsTracker(_postUtil, "userName", "password", false);

            Expect.Call(_postUtil.PostData(null, null)).IgnoreArguments()
                .Constraints(Text.StartsWith("http://testing.shippingapis.com/ShippingAPITest.dll?API=TrackV2&XML=<TrackRequest"),
                             Is.Null())
                .Return(getSampleResponse("MultipleActivities.xml"));

            mocks.ReplayAll();

            TrackingData td = _tracker.GetTrackingData("9101805213907598388159");

            Assert.AreEqual(4, td.Activity.Count);

            mocks.VerifyAll();
        }
Exemplo n.º 2
0
        public void Invalid_Tracking_Number_Verify_Null_Tracking_Data_Returned()
        {
            _tracker = new UspsTracker(_postUtil, "userName", "password", false);

            Assert.IsNull(_tracker.GetTrackingData("123"));
        }