Beispiel #1
0
        public void TestCrud()
        {
            var account = _client.CreateCarrierAccount(new CarrierAccount {
                Type        = "EndiciaAccount",
                Description = "description",
            }).Result;

            Assert.IsNotNull(account.Id);
            Assert.AreEqual(account.Type, "EndiciaAccount");

            account.Reference = "new-reference";
            account           = _client.UpdateCarrierAccount(account).Result;
            Assert.AreEqual("new-reference", account.Reference);

            _client.DestroyCarrierAccount(account.Id).Wait();

            account = _client.GetCarrierAccount(account.Id).Result;
            Assert.IsNotNull(account.RequestError);
            Assert.AreEqual(account.RequestError.Code, "NOT_FOUND");
        }