public void ValidFreshTrial() { Flex lic = new Flex(); RegistryKey myKey; myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\f7a6c899-2eef-4d98-9191-6af69f5990ed", true); if (null != myKey) { myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", true); myKey.DeleteSubKey("f7a6c899-2eef-4d98-9191-6af69f5990ed"); } Assert.IsTrue(lic.IsTrialLicense()); }
public void InvalidTrial() { Flex lic = new Flex(); RegistryKey myKey; myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\f7a6c899-2eef-4d98-9191-6af69f5990ed", true); if (null != myKey) { myKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", true); myKey.DeleteSubKey("f7a6c899-2eef-4d98-9191-6af69f5990ed"); } myKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\f7a6c899-2eef-4d98-9191-6af69f5990ed"); DateTime exp = System.DateTime.Now; exp.Subtract(new TimeSpan(2, 0, 0, 0)); myKey.SetValue("Install", exp.ToString()); Assert.IsFalse(lic.IsTrialLicense()); }