Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }