Example #1
0
        [Ignore] // TODO API requires tracking codes to be bought on same day to make scan form, but we aren't buying anything, so this fails
        public void TestScanForms()
        {
            var scanForm = _client.CreateScanForm(new ScanForm
            {
                TrackingCodes = new List <string> {
                    "123456", "123455", "123454"
                },
                Address = new Address
                {
                    Name    = "EasyPost",
                    Street1 = "2135 Sacramento St",
                    City    = "San Francisco",
                    State   = "CA",
                    Zip     = "94109",
                    Email   = "*****@*****.**",
                },
            });

            Assert.IsNotNull(scanForm.Id);

            var sameAsScanForm = _client.GetScanForm(scanForm.Id);

            Assert.AreEqual(scanForm.Id, sameAsScanForm.Id);

            var allScanForms = _client.GetScanForms();
            var shouldExist  = allScanForms.SingleOrDefault(x => string.Equals(x.Id, scanForm.Id));

            Assert.IsNotNull(shouldExist);
        }