PowerToys/Wox.Test/QueryTest.cs

38 lines
1.0 KiB
C#
Raw Normal View History

2013-12-19 23:51:20 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
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-02-05 22:20:42 +08:00
public void ExclusivePluginQueryTest()
2013-12-19 23:51:20 +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
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
[Test]
2015-02-05 22:20:42 +08:00
public void GenericPluginQueryTest()
{
Query q = new Query("file.txt file2 file3");
q.Search = q.RawQuery;
2014-02-28 23:21:01 +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
}
}
}