public void RemoveRedirectFromPart_Test(string inText, string expected) { CommandLineOptions option = new CommandLineOptions(); var newUrl = new UrlRepairHelper(option).RemoveUnusePartFromRedirectUrl(inText); Assert.AreEqual(expected, newUrl); }
public void GetDocsUrl_Test(string inText, string expected) { CommandLineOptions option = new CommandLineOptions() { BaseUrl = "https://docs.microsoft.com/en-us" }; var newUrl = new UrlRepairHelper(option).GetDocsUrl(inText); Assert.AreEqual(expected, newUrl); }
public void FixedVersions_Switch_Test(string inText, string expected, bool isFixedVersions, string mockRedirectUrl) { CommandLineOptions option = new CommandLineOptions() { BaseUrl = "https://docs.microsoft.com/en-us", FixedVersions = isFixedVersions }; var urlRepairHelper = new UrlRepairHelper(option); urlRepairHelper.MockTestData(inText, mockRedirectUrl); var newUrl = urlRepairHelper.GetDocsUrl(inText); Assert.AreEqual(expected, newUrl); }
public void RepairString_Test(string inText, string expected, string msdnUrl, string mockRedirectUrl) { CommandLineOptions option = new CommandLineOptions() { BaseUrl = "https://docs.microsoft.com/en-us", FixedVersions = true, PreVersions = true }; var urlRepairHelper = new UrlRepairHelper(option); urlRepairHelper.MockTestData(msdnUrl, mockRedirectUrl); var newText = urlRepairHelper.RepairString(inText, null); Assert.AreEqual(expected, newText); }