Пример #1
0
        public void ConvertNullAPIToAPI()
        {
            apiLicense = null;
            converter  = new LicenseConverter(apiLicense);

            Assert.IsNull(converter.ToAPILicense());
        }
Пример #2
0
        public void ConvertNullSDKToAPI()
        {
            sdkLicense = null;
            converter  = new LicenseConverter(sdkLicense);

            Assert.IsNull(converter.ToAPILicense());
        }
Пример #3
0
        public void ConvertAPIToAPI()
        {
            apiLicense = CreateTypicalAPILicense();
            converter  = new LicenseConverter(apiLicense);

            OneSpanSign.API.License license = converter.ToAPILicense();

            Assert.IsNotNull(license);
            Assert.AreEqual(apiLicense, license);
        }
Пример #4
0
        public void ConvertSDKToAPI()
        {
            sdkLicense = CreateTypicalSDKLicense();
            converter  = new LicenseConverter(sdkLicense);

            OneSpanSign.API.License license = converter.ToAPILicense();

            Assert.IsNotNull(license);
            Assert.AreEqual(LIC_STATUS, license.Status);
            Assert.AreEqual(1, license.Transactions.Count);
            Assert.AreEqual(LIC_TRANS_CC_NUM, license.Transactions[0].CreditCard.Number);
            Assert.AreEqual(LIC_TRANS_PRICE_AMOUNT, license.Transactions[0].Price.Amount);
            Assert.AreEqual(LIC_PLAN_CONTRACT, license.Plan.Contract);
            Assert.AreEqual(LIC_PLAN_PRICE_AMOUNT, license.Plan.Price.Amount);
        }