Exemplo n.º 1
0
        public void ConvertSDKToAPI()
        {
            sdkAccount = CreateTypicalSDKAccount();
            converter  = new AccountConverter(sdkAccount);

            OneSpanSign.API.Account account = converter.ToAPIAccount();

            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);
        }
Exemplo n.º 2
0
        public void ConvertNullAPIToAPI()
        {
            apiAccount = null;
            converter  = new AccountConverter(apiAccount);

            Assert.IsNull(converter.ToAPIAccount());
        }
Exemplo n.º 3
0
        public void ConvertNullSDKToAPI()
        {
            sdkAccount = null;
            converter  = new AccountConverter(sdkAccount);

            Assert.IsNull(converter.ToAPIAccount());
        }
Exemplo n.º 4
0
        public void ConvertAPIToAPI()
        {
            apiAccount = CreateTypicalAPIAccount();
            converter  = new AccountConverter(apiAccount);

            OneSpanSign.API.Account account = converter.ToAPIAccount();

            Assert.IsNotNull(account);
            Assert.AreEqual(apiAccount, account);
        }