diff --git a/Flow.Launcher.Core/Flow.Launcher.Core.csproj b/Flow.Launcher.Core/Flow.Launcher.Core.csproj
index 8d1408449..d7df11f83 100644
--- a/Flow.Launcher.Core/Flow.Launcher.Core.csproj
+++ b/Flow.Launcher.Core/Flow.Launcher.Core.csproj
@@ -58,10 +58,6 @@
-
-
-
-
diff --git a/Flow.Launcher.Core/Properties/AssemblyInfo.cs b/Flow.Launcher.Core/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..8a5aa0231
--- /dev/null
+++ b/Flow.Launcher.Core/Properties/AssemblyInfo.cs
@@ -0,0 +1,4 @@
+using System.Runtime.CompilerServices;
+
+[assembly: InternalsVisibleTo("Flow.Launcher")]
+[assembly: InternalsVisibleTo("Flow.Launcher.Test")]
\ No newline at end of file
diff --git a/Flow.Launcher.Test/Flow.Launcher.Test.csproj b/Flow.Launcher.Test/Flow.Launcher.Test.csproj
index 1d0dce5e7..84c9137b7 100644
--- a/Flow.Launcher.Test/Flow.Launcher.Test.csproj
+++ b/Flow.Launcher.Test/Flow.Launcher.Test.csproj
@@ -49,12 +49,12 @@
-
-
+
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
-
+
\ No newline at end of file
diff --git a/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs
new file mode 100644
index 000000000..2f44d70ff
--- /dev/null
+++ b/Flow.Launcher.Test/Plugins/JsonRPCPluginTest.cs
@@ -0,0 +1,98 @@
+using NUnit;
+using NUnit.Framework;
+using Flow.Launcher.Core.Plugin;
+using Flow.Launcher.Plugin;
+using System.Threading.Tasks;
+using System.IO;
+using System.Threading;
+using System.Text;
+using System.Text.Json;
+using System.Linq;
+using System.Collections.Generic;
+
+namespace Flow.Launcher.Test.Plugins
+{
+ [TestFixture]
+ // ReSharper disable once InconsistentNaming
+ internal class JsonRPCPluginTest : JsonRPCPlugin
+ {
+ public override string SupportedLanguage { get; set; } = AllowedLanguage.Executable;
+
+ protected override string ExecuteCallback(JsonRPCRequestModel rpcRequest)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ protected override string ExecuteContextMenu(Result selectedResult)
+ {
+ throw new System.NotImplementedException();
+ }
+
+ protected override Task ExecuteQueryAsync(Query query, CancellationToken token)
+ {
+ var byteInfo = Encoding.UTF8.GetBytes(query.RawQuery);
+
+ var resultStream = new MemoryStream(byteInfo);
+ return Task.FromResult((Stream)resultStream);
+ }
+
+ [TestCase("{\"result\":[],\"DebugMessage\":null}", Description = "Empty Result")]
+ [TestCase("{\"result\":[{\"JsonRPCAction\":null,\"Title\":null,\"SubTitle\":\"\",\"ActionKeywordAssigned\":null,\"IcoPath\":null}],\"DebugMessage\":null}", Description = "One Result with Pascal Case")]
+ [TestCase("{\"result\":[{\"jsonRPCAction\":null,\"title\":null,\"subTitle\":\"\",\"actionKeywordAssigned\":null,\"icoPath\":null}],\"debugMessage\":null}", Description = "One Result with camel Case")]
+ [TestCase("{\"result\":[{\"JsonRPCAction\":null,\"Title\":null,\"SubTitle\":\"\",\"ActionKeywordAssigned\":null,\"IcoPath\":null},{\"JsonRPCAction\":null,\"Title\":null,\"SubTitle\":\"\",\"ActionKeywordAssigned\":null,\"IcoPath\":null}],\"DebugMessage\":null}", Description = "Two Result with Pascal Case")]
+ public async Task BasicQueryTestAsync(string resultText)
+ {
+ var results = await QueryAsync(new Query
+ {
+ RawQuery = resultText
+ }, default);
+
+ Assert.IsNotNull(results);
+
+ foreach (var result in results)
+ {
+ Assert.IsNotNull(result);
+ Assert.IsNotNull(result.Action);
+ }
+
+ }
+
+ public static List ResponseModelsSource = new()
+ {
+ new()
+ {
+ Result = new()
+ },
+ new()
+ {
+ Result = new()
+ {
+ new JsonRPCResult
+ {
+ Title = "Test1",
+ SubTitle = "Test2"
+ }
+ }
+ }
+ };
+
+ [TestCaseSource(typeof(JsonRPCPluginTest), nameof(ResponseModelsSource))]
+ public async Task QueryTestPropertyMatchAsync(JsonRPCQueryResponseModel model)
+ {
+ var pascalText = JsonSerializer.Serialize(model);
+
+ var results = await QueryAsync(new Query { RawQuery = pascalText, }, default);
+
+ Assert.IsNotNull(results);
+
+ foreach (var (result1, result2) in results.Zip(model.Result))
+ {
+ Assert.IsNotNull(result1);
+ Assert.IsNotNull(result1.Action);
+ Assert.AreEqual(result1.Title, result2.Title);
+ Assert.AreEqual(result1.SubTitle, result2.SubTitle);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Flow.Launcher.Test/Plugins/PluginInitTest.cs b/Flow.Launcher.Test/Plugins/PluginInitTest.cs
index 299a837ee..7530dae58 100644
--- a/Flow.Launcher.Test/Plugins/PluginInitTest.cs
+++ b/Flow.Launcher.Test/Plugins/PluginInitTest.cs
@@ -11,7 +11,7 @@ namespace Flow.Launcher.Test.Plugins
[Test]
public void PublicAPIIsNullTest()
{
- //Assert.Throws(typeof(Flow.LauncherFatalException), () => PluginManager.Initialize(null));
+ //Ap[ssert.Throws(typeof(Flow.LauncherFatalException), () => PluginManager.Initialize(null));
}
}
}
diff --git a/global.json b/global.json
index 2ad4d9100..75055e1c6 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
{
"sdk": {
- "version": "5.0.100",
+ "version": "5.0.300",
"rollForward": "latestFeature"
}
}
\ No newline at end of file