public void ProductManifestTest() { FileInfo _fi = new FileInfo(FileNames.ManifestFileName); Assert.IsFalse(_fi.Exists, FileNames.ManifestFileName); FileNames.UnloadProductManifest(); DeployManifest _manifest = FileNames.ProductManifest(); Assert.IsNull(_manifest); FileInfo _testManifest = new FileInfo(Path.Combine(@"TestingData\", "CAS.Product.xml")); Assert.IsTrue(_testManifest.Exists); _testManifest.CopyTo(FileNames.ManifestFileName); FileInfo _manifestFileInfo = new FileInfo(FileNames.ManifestFileName); Assert.IsTrue(_manifestFileInfo.Exists); _manifest = FileNames.ProductManifest(); Assert.IsNotNull(_manifest); _manifestFileInfo.Delete(); _manifestFileInfo.Refresh(); Assert.IsFalse(_manifestFileInfo.Exists); _manifest = FileNames.ProductManifest(); Assert.IsNotNull(_manifest); Assert.AreEqual(@"TestApplicationDataPath\0D42ACCD-BBE0-4F79-9307-B746E6E09937", FileNames.ApplicationDataPath); FileNames.UnloadProductManifest(); _manifest = FileNames.ProductManifest(); Assert.IsNull(_manifest); }
public void InstallLicenseFromContainerAllParametersTest() { try { LibInstaller.InstallLicense("user", "company", "email", true, "", "", Assembly.GetExecutingAssembly()); Assert.Fail(); } catch (Exception ex) { DeployManifest _manifest = FileNames.ProductManifest(); Assert.IsNotNull(_manifest); Assert.AreEqual <string>("CAS.CodeProtect.UnitTests", _manifest.Product); Assert.IsFalse(ex.Message.Contains("CAS.CodeProtect.UnitTests")); Assert.IsTrue(ex.Message.Contains("CodeProtect.UnitTests")); ManifestManagement.DeleteDeployManifest(); } }
public void InstallLicenseFromContainerDefaultParametersTest() { try { LibInstaller.InstallLicense(true); Assert.Fail(); } catch (Exception ex) { DeployManifest _manifest = FileNames.ProductManifest(); Assert.IsNotNull(_manifest); Assert.AreEqual <string>("CAS.CodeProtect.UnitTests", _manifest.Product); Assert.IsFalse(ex.Message.Contains("CAS.CodeProtect.UnitTests")); Assert.IsTrue(ex.Message.Contains("CodeProtect.UnitTests")); ManifestManagement.DeleteDeployManifest(); } }