public void convertSDKToSDK()
 {
     sdkDataManagementPolicy1 = new DataManagementPolicy();
     sdkDataManagementPolicy2 = new DataManagementPolicyConverter(sdkDataManagementPolicy1).ToSDKDataManagementPolicy();
     Assert.IsNotNull(sdkDataManagementPolicy2);
     Assert.AreEqual(sdkDataManagementPolicy2, sdkDataManagementPolicy1);
 }
        public DataManagementPolicy Build()
        {
            DataManagementPolicy result = new DataManagementPolicy();

            result.TransactionRetention = transactionRetention;
            return(result);
        }
Example #3
0
        internal OneSpanSign.Sdk.DataManagementPolicy ToSDKDataManagementPolicy()
        {
            if (apiDataManagementPolicy == null)
            {
                return(sdkDataManagementPolicy);
            }
            sdkDataManagementPolicy = new DataManagementPolicy();
            if (apiDataManagementPolicy.TransactionRetention != null)
            {
                sdkDataManagementPolicy.TransactionRetention = new TransactionRetentionConverter(apiDataManagementPolicy.TransactionRetention)
                                                               .ToSDKTransactionRetention();
            }

            return(sdkDataManagementPolicy);
        }
        public void convertSDKToAPI()
        {
            sdkDataManagementPolicy1 = new DataManagementPolicy();
            sdkDataManagementPolicy1.TransactionRetention = buildSdkTransactionRetention();
            apiDataManagementPolicy1 = new DataManagementPolicyConverter(sdkDataManagementPolicy1).ToAPIDataManagementPolicy();

            Assert.IsNotNull(apiDataManagementPolicy1);
            Assert.IsNotNull(apiDataManagementPolicy1.TransactionRetention);
            Assert.AreEqual(apiDataManagementPolicy1.TransactionRetention.Expired, 10);
            Assert.AreEqual(apiDataManagementPolicy1.TransactionRetention.Sent, 20);
            Assert.AreEqual(apiDataManagementPolicy1.TransactionRetention.Archived, 30);
            Assert.AreEqual(apiDataManagementPolicy1.TransactionRetention.Completed, 40);
            Assert.AreEqual(apiDataManagementPolicy1.TransactionRetention.Declined, 50);
            Assert.AreEqual(apiDataManagementPolicy1.TransactionRetention.Draft, 60);
            Assert.AreEqual(apiDataManagementPolicy1.TransactionRetention.OptedOut, 70);
        }
        public void convertAPIToSDK()
        {
            apiDataManagementPolicy1 = new OneSpanSign.API.DataManagementPolicy();
            apiDataManagementPolicy1.TransactionRetention = buildApiTransactionRetention();
            sdkDataManagementPolicy1 = new DataManagementPolicyConverter(apiDataManagementPolicy1).ToSDKDataManagementPolicy();

            Assert.IsNotNull(sdkDataManagementPolicy1);
            Assert.IsNotNull(sdkDataManagementPolicy1.TransactionRetention);
            Assert.AreEqual(sdkDataManagementPolicy1.TransactionRetention.Expired, 10);
            Assert.AreEqual(sdkDataManagementPolicy1.TransactionRetention.Sent, 20);
            Assert.AreEqual(sdkDataManagementPolicy1.TransactionRetention.Archived, 30);
            Assert.AreEqual(sdkDataManagementPolicy1.TransactionRetention.Completed, 40);
            Assert.AreEqual(sdkDataManagementPolicy1.TransactionRetention.Declined, 50);
            Assert.AreEqual(sdkDataManagementPolicy1.TransactionRetention.Draft, 60);
            Assert.AreEqual(sdkDataManagementPolicy1.TransactionRetention.OptedOut, 70);
        }
Example #6
0
 public DataManagementPolicyConverter(DataManagementPolicy sdkDataManagementPolicy)
 {
     this.sdkDataManagementPolicy = sdkDataManagementPolicy;
 }
 public void convertNullSDKToSDK()
 {
     sdkDataManagementPolicy1 = null;
     converter = new DataManagementPolicyConverter(sdkDataManagementPolicy1);
     Assert.IsNull(converter.ToSDKDataManagementPolicy());
 }