2015-10-31 07:17:34 +08:00
|
|
|
|
using NUnit.Framework;
|
2015-01-03 15:20:34 +08:00
|
|
|
|
using Wox.Plugin.Url;
|
2014-12-16 00:07:12 +08:00
|
|
|
|
|
|
|
|
|
namespace Wox.Test
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class UrlPluginTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
|
|
|
|
public void URLMatchTest()
|
|
|
|
|
{
|
|
|
|
|
UrlPlugin urlPlugin = new UrlPlugin();
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("http://www.google.com"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("https://www.google.com"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("http://google.com"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("www.google.com"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("google.com"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("http://localhost"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("https://localhost"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("http://localhost:80"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("https://localhost:80"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("http://110.10.10.10"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("110.10.10.10"));
|
|
|
|
|
Assert.IsTrue(urlPlugin.IsURL("ftp://110.10.10.10"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Assert.IsFalse(urlPlugin.IsURL("wwww"));
|
|
|
|
|
Assert.IsFalse(urlPlugin.IsURL("wwww.c"));
|
2015-02-06 18:13:22 +08:00
|
|
|
|
Assert.IsFalse(urlPlugin.IsURL("wwww.c"));
|
2014-12-16 00:07:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|