예제 #1
0
        public void TestParcels()
        {
            var customParcel = _client.CreateParcel(new Parcel
            {
                LengthInches = 6,
                WidthInches  = 6,
                HeightInches = 4,
                WeightOunces = 13,
            });

            Assert.IsNotNull(customParcel.Id);

            var parcel = _client.CreateParcel(new Parcel
            {
                PredefinedPackage = ParcelType.FedExEnvelope,
                WeightOunces      = 2,
            });

            Assert.IsNotNull(parcel.Id);

            var sameAsCustomParcel = _client.GetParcel(customParcel.Id);

            Assert.AreEqual(customParcel.Id, sameAsCustomParcel.Id);

            var allParcels  = _client.GetParcels();
            var shouldExist = allParcels.SingleOrDefault(x => string.Equals(x.Id, customParcel.Id));

            Assert.IsNotNull(shouldExist);
        }