2015-10-30 23:17:34 +00:00
|
|
|
|
using NUnit.Framework;
|
2020-04-21 09:12:17 +00:00
|
|
|
|
using Flow.Launcher.Plugin.Url;
|
2014-12-15 16:07:12 +00:00
|
|
|
|
|
2020-04-21 09:12:17 +00:00
|
|
|
|
namespace Flow.Launcher.Test
|
2014-12-15 16:07:12 +00:00
|
|
|
|
{
|
|
|
|
|
|
[TestFixture]
|
|
|
|
|
|
public class UrlPluginTest
|
|
|
|
|
|
{
|
|
|
|
|
|
[Test]
|
|
|
|
|
|
public void URLMatchTest()
|
|
|
|
|
|
{
|
2016-05-07 16:04:16 +00:00
|
|
|
|
var plugin = new Main();
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("http://www.google.com"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("https://www.google.com"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("http://google.com"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("www.google.com"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("google.com"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("http://localhost"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("https://localhost"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("http://localhost:80"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("https://localhost:80"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("http://110.10.10.10"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("110.10.10.10"));
|
|
|
|
|
|
Assert.IsTrue(plugin.IsURL("ftp://110.10.10.10"));
|
2014-12-15 16:07:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
2016-05-07 16:04:16 +00:00
|
|
|
|
Assert.IsFalse(plugin.IsURL("wwww"));
|
|
|
|
|
|
Assert.IsFalse(plugin.IsURL("wwww.c"));
|
|
|
|
|
|
Assert.IsFalse(plugin.IsURL("wwww.c"));
|
2014-12-15 16:07:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|