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()
|
|
|
|
|
{
|
2016-05-08 00:04:16 +08: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-16 00:07:12 +08:00
|
|
|
|
|
|
|
|
|
|
2016-05-08 00:04:16 +08:00
|
|
|
|
Assert.IsFalse(plugin.IsURL("wwww"));
|
|
|
|
|
Assert.IsFalse(plugin.IsURL("wwww.c"));
|
|
|
|
|
Assert.IsFalse(plugin.IsURL("wwww.c"));
|
2014-12-16 00:07:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|