Exemple #1
0
        public void RemoveRedirectFromPart_Test(string inText, string expected)
        {
            CommandLineOptions option = new CommandLineOptions();
            var newUrl = new UrlRepairHelper(option).RemoveUnusePartFromRedirectUrl(inText);

            Assert.AreEqual(expected, newUrl);
        }
Exemple #2
0
        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);
        }
Exemple #3
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);
        }
Exemple #4
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);
        }