Ejemplo n.º 1
0
        public void ConvertNullAPIToAPI()
        {
            apiSubAccount = null;
            converter     = new SubAccountConverter(apiSubAccount);

            Assert.IsNull(converter.ToAPISubAccount());
        }
Ejemplo n.º 2
0
        public void ConvertAPIToSDK()
        {
            apiSubAccount = CreateTypicalAPISubAccount();
            converter     = new SubAccountConverter(apiSubAccount);
            SubAccount subAccount = converter.ToSDKSubAccount();

            Assert.IsNotNull(subAccount);
        }
Ejemplo n.º 3
0
        public void ConvertAPIToAPI()
        {
            apiSubAccount = CreateTypicalAPISubAccount();
            converter     = new SubAccountConverter(apiSubAccount);

            OneSpanSign.API.SubAccount subAccount = converter.ToAPISubAccount();

            Assert.IsNotNull(subAccount);
            Assert.AreEqual(apiSubAccount, subAccount);
        }
Ejemplo n.º 4
0
        private OneSpanSign.API.SubAccount CreateTypicalAPISubAccount()
        {
            OneSpanSign.API.SubAccount subAccount = new OneSpanSign.API.SubAccount();

            subAccount.Language        = SUBACCOUNT_LANGUAGE;
            subAccount.TimezoneId      = SUBACCOUNT_TIMEZONE_ID;
            subAccount.ParentAccountId = SUBACCOUNT_PARENT_ACCOUNT_ID;
            subAccount.Name            = SUBACCOUNT_NAME;

            return(subAccount);
        }
Ejemplo n.º 5
0
        public void ConvertSDKToAPI()
        {
            sdkSubAccount = CreateTypicalSDKSubAccount();
            converter     = new SubAccountConverter(sdkSubAccount);

            OneSpanSign.API.SubAccount subAccount = converter.ToAPISubAccount();

            Assert.IsNotNull(subAccount);
            Assert.AreEqual(SUBACCOUNT_LANGUAGE, subAccount.Language, "language was not set correctly");
            Assert.AreEqual(SUBACCOUNT_NAME, subAccount.Name, "Name was not set correctly");
            Assert.AreEqual(SUBACCOUNT_TIMEZONE_ID, subAccount.TimezoneId, "TimezoneId was not set correctly");
            Assert.AreEqual(SUBACCOUNT_PARENT_ACCOUNT_ID, subAccount.ParentAccountId,
                            "ParentAccountId was not set correctly");
        }
Ejemplo n.º 6
0
 public OneSpanSign.API.SubAccount ToAPISubAccount()
 {
     if (apiSubAccount != null)
     {
         return(apiSubAccount);
     }
     else if (sdkSubAccount != null)
     {
         OneSpanSign.API.SubAccount result = new OneSpanSign.API.SubAccount();
         result.Name            = sdkSubAccount.Name;
         result.Language        = sdkSubAccount.Language;
         result.TimezoneId      = sdkSubAccount.TimezoneId;
         result.ParentAccountId = sdkSubAccount.ParentAccountId;
         return(result);
     }
     else
     {
         return(null);
     }
 }
Ejemplo n.º 7
0
 public SubAccountConverter(OneSpanSign.API.SubAccount apiSubAccount)
 {
     this.apiSubAccount = apiSubAccount;
 }