PowerToys/Wox.Test/QueryTest.cs

32 lines
878 B
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;
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]
public void QueryActionTest()
{
Query q = new Query("this");
q = new Query("ev file.txt");
Assert.AreEqual(q.ActionName,"ev");
Assert.AreEqual(q.ActionParameters.Count,1);
Assert.AreEqual(q.ActionParameters[0],"file.txt");
q = new Query("ev file.txt file2.txt");
Assert.AreEqual(q.ActionName,"ev");
Assert.AreEqual(q.ActionParameters.Count,2);
Assert.AreEqual(q.ActionParameters[1],"file2.txt");
2014-02-28 23:21:01 +08:00
q = new Query("ev file.txt file2.tx st");
Assert.AreEqual(q.GetAllRemainingParameter(), "file.txt file2.tx st");
2013-12-19 23:51:20 +08:00
}
}
}