PowerToys/Wox.Test/UrlPluginTest.cs
2016-05-08 17:27:59 +01:00

33 lines
1.1 KiB
C#

using NUnit.Framework;
using Wox.Plugin.Url;
namespace Wox.Test
{
[TestFixture]
public class UrlPluginTest
{
[Test]
public void URLMatchTest()
{
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"));
Assert.IsFalse(plugin.IsURL("wwww"));
Assert.IsFalse(plugin.IsURL("wwww.c"));
Assert.IsFalse(plugin.IsURL("wwww.c"));
}
}
}