public void LoadAlteredLicense()
        {
            LicenseManager manager = new LicenseManager();

            manager.LoadPublicKeyFromString(TestKeys.PublicKey);
            License testLicense = manager.LoadLicenseFromString(TestLicenses.GetTestAlteredLicenseString());
        }
        public void LoadNonXml()
        {
            LicenseManager manager = new LicenseManager();

            manager.LoadPublicKeyFromString(TestKeys.PublicKey);
            License testLicense = manager.LoadLicenseFromString(TestLicenses.GetNonXml());
        }
        public void LoadSignedLicense()
        {
            LicenseManager manager = new LicenseManager();

            manager.LoadPublicKeyFromString(TestKeys.PublicKey);
            License testLicense = manager.LoadLicenseFromString(TestLicenses.GetTestSignedLicenseString());

            Assert.IsNotNull(testLicense);
        }
        public void CreateNewLicense()
        {
            LicenseManager manager = new LicenseManager();

            manager.LoadPrivateKeyFromString(TestKeys.PrivateKey);
            string expectedFilePath = string.Format("{0}\\testLicense.lic", _classTestDirName);

            manager.SignAndSaveNewLicense(TestLicenses.GetTestNewUnsignedLicense(), expectedFilePath);

            Assert.IsTrue(File.Exists(expectedFilePath));
        }
        public void ReadLicenseAttributes()
        {
            LicenseManager manager = new LicenseManager();

            manager.LoadPublicKeyFromString(TestKeys.PublicKey);
            License testLicense = manager.LoadLicenseFromString(TestLicenses.GetTestSignedLicenseString());

            string company    = testLicense.GetAttribute("Company");
            string licensedOn = testLicense.GetAttribute("LicensedOn");

            Assert.AreEqual("Test Co.", company);
            Assert.AreEqual("6/24/2016", licensedOn);
        }