2013-12-19 23:51:20 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using NUnit.Framework;
|
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-01-26 17:46:55 +08:00
|
|
|
|
public void UserPluginQueryTest()
|
2013-12-19 23:51:20 +08:00
|
|
|
|
{
|
2015-01-26 17:46:55 +08:00
|
|
|
|
Query q = new Query("f file.txt file2 file3");
|
|
|
|
|
q.Search = "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]
|
|
|
|
|
public void SystemPluginQueryTest()
|
|
|
|
|
{
|
|
|
|
|
Query q = new Query("file.txt file2 file3");
|
|
|
|
|
q.Search = q.RawQuery;
|
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
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|