Skip to content

Instantly share code, notes, and snippets.

@cezarypiatek
Created May 13, 2021 10:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cezarypiatek/776f0ba97cf817b0ae1ab0e2bae1398a to your computer and use it in GitHub Desktop.
Save cezarypiatek/776f0ba97cf817b0ae1ab0e2bae1398a to your computer and use it in GitHub Desktop.
Test
SCENARIO: should activate regular license for vs2019
STEP 1: Register purchase for VS2019
STEP 2: Activate the license
STEP 3: Verify that license activated properly
[Test]
public async Task should_activate_multiple_regular_license_for_bought_on_the_same_email()
{
using var driver = await LicenseServerTestDriver.Create();
var scenario = new TestScenario();
var email = "abs@payhip.com";
var licenseKeyForVs2017 = "WTKP4-66NL5-HMKQW-G2017";
var licenseKeyForVs2019 = "WTKP4-66NL5-HMKQW-G2019";
var licenseKeyForVs2022 = "WTKP4-66NL5-HMKQW-G2022";
await scenario.Step("Register purchase for VS2017, VS2019 and VS2022", async () =>
{
await driver.RegisterPurchase("MappingGenerator for VS2017", email, licenseKeyForVs2017);
await driver.RegisterPurchase("MappingGenerator for VS2019", email, licenseKeyForVs2019);
await driver.RegisterPurchase("MappingGenerator for VS2022", email, licenseKeyForVs2022);
});
await scenario.Step("Activate the license for vs2017", async () =>
{
var activationResult = await driver.ActivateLicense(email, licenseKeyForVs2017);
await scenario.Step("Verify if license activated properly", () =>
{
Assert.AreEqual(true, activationResult.Activated);
Assert.AreEqual("VS2017", activationResult.Capabilities["VsVersion"]);
});
});
await scenario.Step("Activate the license for vs2019", async () =>
{
var activationResult = await driver.ActivateLicense(email, licenseKeyForVs2019);
await scenario.Step("Verify if license activated properly", () =>
{
Assert.AreEqual(true, activationResult.Activated);
Assert.AreEqual("VS2019", activationResult.Capabilities["VsVersion"]);
});
});
await scenario.Step("Activate the license for vs2022", async () =>
{
var activationResult = await driver.ActivateLicense(email, licenseKeyForVs2022);
await scenario.Step("Verify if license activated properly", () =>
{
Assert.AreEqual(true, activationResult.Activated);
Assert.AreEqual("VS2022", activationResult.Capabilities["VsVersion"]);
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment