示例#1
0
        public void GetDataTest()
        {
            CheckTwoFactorAuthURLExt plugin = new CheckTwoFactorAuthURLExt();

            foreach (TwoFactorSite item in plugin.GetData())
            {
                Assert.AreNotEqual(string.Empty, item);
            }

            File.WriteAllLines("urls.txt", plugin.GetData().Select(entry => entry.URL));
        }
示例#2
0
        public void FindMatchingEntriesTest()
        {
            CheckTwoFactorAuthURLExt plugin = new CheckTwoFactorAuthURLExt();

            plugin.Init();

            Assert.Multiple(() =>
            {
                Assert.AreEqual(string.Empty, plugin.FindMatchingEntries("aa"));

                this.TestEmpty("https://this.is.not.a.real.url.com", plugin);

                this.TestNotEmpty("https://someotherdomain.google.com", plugin);

                this.TestNotEmpty("https://drive.google.com", plugin);
                this.TestNotEmpty("https://drive.google.com/", plugin);
                this.TestNotEmpty("https://drive.google.com/somesuffix", plugin);
                this.TestNotEmpty("http://drive.google.com/", plugin);

                this.TestNotEmpty("www.humblebundle.com", plugin);
                this.TestNotEmpty("www.apple.com", plugin);
                this.TestNotEmpty("paypal.com", plugin);
                this.TestNotEmpty("https://www.linkedin.com", plugin);
                this.TestNotEmpty("https://online.hmrc.gov.uk", plugin);
                this.TestNotEmpty("https://login.skype.com", plugin);
                this.TestNotEmpty("https://support.snapchat.com", plugin);
                this.TestNotEmpty("https://accounts.spotify.com", plugin);
                this.TestNotEmpty("https://www.starbucks.co.uk", plugin);

                this.TestNotEmpty("https://steamcommunity.com", plugin);
                this.TestNotEmpty("store.steampowered.com", plugin);

                this.TestNotEmpty("https://tickets.scotrail.co.uk", plugin);
                this.TestNotEmpty("twitch.tv", plugin);
                this.TestNotEmpty("https://auth.uber.com", plugin);

                this.TestEmpty("https://www.easyjet.com", plugin);
                this.TestEmpty("https://yourlibrary.edinburgh.gov.uk", plugin);
                this.TestEmpty("https://www.royalmail.com", plugin);
            });
        }
示例#3
0
 private void TestEmpty(string url, CheckTwoFactorAuthURLExt plugin)
 {
     Assert.IsEmpty(plugin.FindMatchingEntries(url), url);
 }