2015-10-31 07:17:34 +08:00
|
|
|
|
using NUnit.Framework;
|
2015-11-03 13:09:54 +08:00
|
|
|
|
using Wox.Core.Plugin;
|
2014-01-29 18:33:24 +08:00
|
|
|
|
using Wox.Plugin;
|
2013-12-19 23:51:20 +08:00
|
|
|
|
|
2014-01-29 18:33:24 +08:00
|
|
|
|
namespace Wox.Test
|
2013-12-19 23:51:20 +08:00
|
|
|
|
{
|
|
|
|
|
public class QueryTest
|
|
|
|
|
{
|
|
|
|
|
[Test]
|
2015-11-04 09:05:03 +08:00
|
|
|
|
[Ignore("Current query is tightly integrated with GUI, can't be tested.")]
|
2015-02-05 22:20:42 +08:00
|
|
|
|
public void ExclusivePluginQueryTest()
|
2013-12-19 23:51:20 +08:00
|
|
|
|
{
|
2015-11-03 13:09:54 +08:00
|
|
|
|
Query q = PluginManager.QueryInit("> file.txt file2 file3");
|
2013-12-19 23:51:20 +08:00
|
|
|
|
|
2015-01-26 17:46:55 +08:00
|
|
|
|
Assert.AreEqual(q.FirstSearch, "file.txt");
|
|
|
|
|
Assert.AreEqual(q.SecondSearch, "file2");
|
|
|
|
|
Assert.AreEqual(q.ThirdSearch, "file3");
|
|
|
|
|
Assert.AreEqual(q.SecondToEndSearch, "file2 file3");
|
|
|
|
|
}
|
2013-12-19 23:51:20 +08:00
|
|
|
|
|
2015-01-26 17:46:55 +08:00
|
|
|
|
[Test]
|
2015-11-04 09:05:03 +08:00
|
|
|
|
[Ignore("Current query is tightly integrated with GUI, can't be tested.")]
|
2015-02-05 22:20:42 +08:00
|
|
|
|
public void GenericPluginQueryTest()
|
2015-01-26 17:46:55 +08:00
|
|
|
|
{
|
2015-11-03 13:09:54 +08:00
|
|
|
|
Query q = PluginManager.QueryInit("file.txt file2 file3");
|
2014-02-28 23:21:01 +08:00
|
|
|
|
|
2015-01-26 17:46:55 +08:00
|
|
|
|
Assert.AreEqual(q.FirstSearch, "file.txt");
|
|
|
|
|
Assert.AreEqual(q.SecondSearch, "file2");
|
|
|
|
|
Assert.AreEqual(q.ThirdSearch, "file3");
|
|
|
|
|
Assert.AreEqual(q.SecondToEndSearch, "file2 file3");
|
2013-12-19 23:51:20 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|