public void CreateAndValidateAM() { SKGL.Generate gen = new SKGL.Generate(); string a = gen.doKey(30); SKGL.Validate ValidateAKey = new SKGL.Validate(); ValidateAKey.Key = a; Assert.IsTrue(ValidateAKey.IsValid == true); Assert.IsTrue(ValidateAKey.IsExpired == false); Assert.IsTrue(ValidateAKey.SetTime == 30); if (ValidateAKey.IsValid) { // displaying date // remember to use .ToShortDateString after each date! Console.WriteLine("This key is created {0}", ValidateAKey.CreationDate.ToShortDateString()); Console.WriteLine("This key will expire {0}", ValidateAKey.ExpireDate.ToShortDateString()); Console.WriteLine("This key is set to be valid in {0} day(s)", ValidateAKey.SetTime); Console.WriteLine("This key has {0} day(s) left", ValidateAKey.DaysLeft); } else { // if invalid Console.WriteLine("Invalid!"); } }
private void btnGenerate_Click(object sender, EventArgs e) { // Generate button SKGL.Generate generate = new SKGL.Generate(); generate.secretPhase = txtPassword.Text; txtSerial.Text = generate.doKey(Convert.ToInt32(txtDay.Text)); }
public void MachineCodeTest() { var gen = new SKGL.Generate(); var a = gen.MachineCode.ToString(); Assert.IsNotNull(a); Console.WriteLine($"MachineCode: {a}"); }
public string GenerateInvite() { var createKey = new SKGL.Generate() { secretPhase = _code }; return(createKey.doKey(DaysExpired)); }
async Task <int> generateMachineID() { await Task.Run(() => { MachineID = new SKGL.Generate().MachineCode; }); return(MachineID); }
public void CreateAndValidate999Days() { SKGL.Generate gen = new SKGL.Generate(); string a = gen.doKey(999); SKGL.Validate val = new SKGL.Validate(); val.Key = a; Assert.IsTrue(val.IsValid == true); Assert.IsTrue(val.IsExpired == false); }
public void CreateAndValidateSimple() { SKGL.Generate gen = new SKGL.Generate(); string a = gen.doKey(30); SKGL.Validate val = new SKGL.Validate(); val.Key = a; Assert.IsTrue(val.IsValid == true); Assert.IsTrue(val.IsExpired == false); Assert.IsTrue(val.SetTime == 30); }
public void CreateAndValidate999DaysWithSecretPhase() { SKGL.Generate gen = new SKGL.Generate(); gen.secretPhase = "d87e468e-02ae-4112-a687-fb4a402a2f7a"; string a = gen.doKey(999); SKGL.Validate val = new SKGL.Validate(); val.secretPhase = "d87e468e-02ae-4112-a687-fb4a402a2f7a"; val.Key = a; Assert.IsTrue(val.IsValid == true); Assert.IsTrue(val.IsExpired == false); }
public void CreateAndValidateSimple() { // Arrange var gen = new SKGL.Generate(); var a = gen.DoKey(30); // Act var val = new SKGL.Validate { Key = a }; // Assert Assert.IsTrue(val.IsValid); Assert.IsTrue(val.IsExpired == false); Assert.IsTrue(val.SetTime == 30); }
public void CreateAndValidateC() { SKGL.SerialKeyConfiguration skm = new SKGL.SerialKeyConfiguration(); SKGL.Generate gen = new SKGL.Generate(skm); skm.Features[0] = true; gen.secretPhase = "567"; string a = gen.doKey(37); SKGL.Validate val = new SKGL.Validate(); val.Key = a; val.secretPhase = "567"; Assert.IsTrue(val.IsValid == true); Assert.IsTrue(val.IsExpired == false); Assert.IsTrue(val.SetTime == 37); Assert.IsTrue(val.Features[0] == true); Assert.IsTrue(val.Features[1] == false); }
public void CreateAndValidateC() { var skm = new SKGL.SerialKeyConfiguration(); var gen = new SKGL.Generate(skm); skm.Features[0] = true; gen.SecretPhrase = "567"; var a = gen.DoKey(37); var val = new SKGL.Validate { Key = a, SecretPhrase = "567" }; Assert.IsTrue(val.IsValid); Assert.IsTrue(val.IsExpired == false); Assert.IsTrue(val.SetTime == 37); Assert.IsTrue(val.Features[0]); Assert.IsTrue(val.Features[1] == false); }
public void MachineCodeTest() { SKGL.Generate gen = new SKGL.Generate(); string a = gen.MachineCode.ToString(); }
private void GetCodeBtn_Click(object sender, EventArgs e) { SKGL.SerialKeyConfiguration skc = new SKGL.SerialKeyConfiguration(); SKGL.Generate generate = new SKGL.Generate(skc); MachineCode.Text = generate.MachineCode.ToString(); }
private void GenSerialKey_Click(object sender, EventArgs e) { SKGL.Generate generate = new SKGL.Generate(); generate.secretPhase = Password.Text; SerialKey.Text = generate.doKey(Convert.ToInt32(ActionTime.Text)); }
public void MachineCodeTest() { SKGL.Generate gen = new SKGL.Generate(); string a= gen.MachineCode.ToString(); }