private string keygen(KeygenBase platform, KeygenProduct product, int type, string name) { if (name.Length <= 1) { MessageBox.Show(companyUserName[type] + " must be longer than one character", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(""); } if (name.Length > 80) { MessageBox.Show(companyUserName[type] + " must not be greater than eighty characters", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return(""); } string genlicense = platform.Generate(type, name, product.Licence); if (!platform.Check(genlicense, name, product.Licence)) { MessageBox.Show("Generated license did not pass self check, please try again", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(genlicense); }
public void TestJavaScriptPlatform() { platform = new PlatformJavaScript(); foreach (var product in platform.Products) { var types = platform.GenerateLicencetypes(product); for (int i = 0; i < types.Count; i++) { foreach (string company in _testCompanyUserStrings) { var key = platform.Generate(i, company, product.Licence); Assert.IsTrue(platform.Check(key, company, product.Licence)); } } } }