Пример #1
0
        public void ConvertAPIToSDK()
        {
            apiAccount = CreateTypicalAPIAccount();
            converter  = new AccountConverter(apiAccount);
            Account account = converter.ToSDKAccount();

            Assert.IsNotNull(account);
            Assert.AreEqual(ACC_NAME, account.Name);

            Assert.AreEqual(ACC_CO_ID, account.Company.Id);
            Assert.AreEqual(ACC_CO_ADDR_ADDR1, account.Company.Address.Address1);

            Assert.AreEqual(1, account.CustomFields.Count);
            Assert.AreEqual(ACC_FIELD_DEF_VLE, account.CustomFields[0].Value);
            Assert.AreEqual(1, account.CustomFields[0].Translations.Count);
            Assert.AreEqual(ACC_FIELD_TRANSL_LANG, account.CustomFields[0].Translations[0].Language);

            Assert.AreEqual(1, account.Licenses.Count);
            Assert.AreEqual(ACC_LIC_STATUS, account.Licenses[0].Status);
            Assert.AreEqual(1, account.Licenses[0].Transactions.Count);
            Assert.AreEqual(ACC_LIC_TRANS_CC_NUM, account.Licenses[0].Transactions[0].CreditCard.Number);
            Assert.AreEqual(ACC_LIC_TRANS_PRICE_AMOUNT, account.Licenses[0].Transactions[0].Price.Amount);
            Assert.AreEqual(ACC_LIC_PLAN_CONTRACT, account.Licenses[0].Plan.Contract);
            Assert.AreEqual(ACC_LIC_PLAN_PRICE_AMOUNT, account.Licenses[0].Plan.Price.Amount);

            Assert.AreEqual(1, account.Providers.Documents.Count);
            Assert.AreEqual(ACC_PROV_DOC_NAME, account.Providers.Documents[0].Name);
            Assert.AreEqual(1, account.Providers.Users.Count);
            Assert.AreEqual(ACC_PROV_USR_NAME, account.Providers.Users[0].Name);
        }
Пример #2
0
        public void ConvertSDKToSDK()
        {
            sdkAccount = CreateTypicalSDKAccount();
            converter  = new AccountConverter(sdkAccount);
            Account account = converter.ToSDKAccount();

            Assert.IsNotNull(account);
            Assert.AreEqual(sdkAccount, account);
        }
Пример #3
0
 public void ConvertNullSDKToSDK()
 {
     sdkAccount = null;
     converter  = new AccountConverter(sdkAccount);
     Assert.IsNull(converter.ToSDKAccount());
 }
Пример #4
0
 public void ConvertNullAPIToSDK()
 {
     apiAccount = null;
     converter  = new AccountConverter(apiAccount);
     Assert.IsNull(converter.ToSDKAccount());
 }