public void TestIsRegisterationValidNegative() { var registerer = new Registerer("入海勇人"); registerer.CompanyName = "Automation Kobo Project"; registerer.ApplicationName = "EasyReporting"; registerer.RegistrationKey = "asldkfjalskdfjalskdfalsdkfj"; string passPhrase = "H311o W0r1D"; bool result = registerer.IsRegistrationKeyValid(passPhrase); Assert.IsFalse(result); }
public void TestIsRegisterationValid() { var registerer = new Registerer("入海勇人"); registerer.CompanyName = "Automation Kobo Project"; registerer.ApplicationName = "EasyReporting"; registerer.RegistrationKey = "0698-DC1-A08-01ADF5"; string passPhrase = "H311o W0r1D"; bool result = registerer.IsRegistrationKeyValid(passPhrase); Assert.IsTrue(result); }
public void TestGenerateRegistrationKey() { //var registerer = new Registerer("入海勇人"); var registerer = new Registerer("JTKJ"); string passPhrase = "H311o W0r1D"; registerer.ApplicationName = "EasyReporting"; registerer.CompanyName = "Automation Kobo Project"; var dynMethod = registerer.GetType().GetMethod("GenerateProductKey", BindingFlags.NonPublic | BindingFlags.Instance); object productKey = dynMethod.Invoke(registerer, new object[] {passPhrase}); Assert.IsFalse(productKey == null); Debug.WriteLine(String.Format("登録ユーザー:{0}", registerer.RegisteredUser)); Debug.WriteLine("シリアル番号:{0}", productKey); //string productKey = registerer.GenerateProductKey(ref passPhrase); //Debug.WriteLine(String.Format("Product Key: {0}", productKey)); }
public frmRegister() { InitializeComponent(); Text = AssemblyTitle; labelProductName.Text = AssemblyProduct; labelVersion.Text = String.Format("Version {0}", AssemblyVersion); labelCopyright.Text = AssemblyCopyright; labelCompanyName.Text = AssemblyCompany; try { _registerer = new Registerer(); _registerer.CompanyName = AssemblyCompany; _registerer.ApplicationName = AssemblyProduct; _isRegistered = _registerer.IsRegistered(PassPhrase); if (_isRegistered) { txtRegisteredUser.Text = _registerer.RegisteredUser; txtProductKey.Text = _registerer.RegistrationKey; txtRegisteredUser.Enabled = false; txtProductKey.Enabled = false; btnRegister.Text = "再登録"; } else { lblRegisteredFor.Text = "このソフトはシェアウェアです。30日以上使用する場合は登録をお願いします。"; txtRegisteredUser.Enabled = true; txtProductKey.Enabled = true; } } catch (Exception exp) { ExceptionHandler.Handle(exp); } }