From e1f2bc0a19c7a7aad5e07692abc25a2c0ffda7f6 Mon Sep 17 00:00:00 2001 From: Amir Tepper Date: Thu, 17 Oct 2019 12:19:52 +0300 Subject: [PATCH] for unit tetsing --- Wox.Core/Plugin/PluginManager.cs | 2 +- Wox.Plugin/Query.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/Wox.Core/Plugin/PluginManager.cs b/Wox.Core/Plugin/PluginManager.cs index e42cf02e80..d6806e5cb2 100644 --- a/Wox.Core/Plugin/PluginManager.cs +++ b/Wox.Core/Plugin/PluginManager.cs @@ -135,7 +135,7 @@ namespace Wox.Core.Plugin var rawQuery = string.Join(Query.TermSeperater, terms); var actionKeyword = string.Empty; var search = rawQuery; - List actionParameters = terms.ToList(); + var actionParameters = terms.ToList(); if (terms.Length == 0) return null; if (NonGlobalPlugins.ContainsKey(terms[0]) && !Settings.Plugins[NonGlobalPlugins[terms[0]].Metadata.ID].Disabled) diff --git a/Wox.Plugin/Query.cs b/Wox.Plugin/Query.cs index 400ae741f1..4289f0497d 100644 --- a/Wox.Plugin/Query.cs +++ b/Wox.Plugin/Query.cs @@ -6,6 +6,19 @@ namespace Wox.Plugin { public class Query { + internal Query() { } + + /// + /// to allow unit tests for plug ins + /// + public Query(string rawQuery, string search, string[] terms, string actionKeyword = null) + { + Search = search; + RawQuery = rawQuery; + Terms = terms; + ActionKeyword = actionKeyword; + } + /// /// Raw query, this includes action keyword if it has /// We didn't recommend use this property directly. You should always use Search property.