Skip to content

Commit 31ecb43

Browse files
author
Austin Harris
committed
Add a larger varity of tests to the testServer
1 parent 2623b05 commit 31ecb43

2 files changed

Lines changed: 29 additions & 1 deletion

File tree

TestServer_Console/Program.cs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,27 @@ private static void Benchmark()
7272
}
7373
});
7474

75-
for (int i = 0; i < cnt; i++)
75+
for (int i = 0; i < cnt; i+=5)
7676
{
7777
var async = new JsonRpcStateAsync(rpcResultHandler, null);
7878
async.JsonRpc = "{'method':'add','params':[1,2],'id':1}";
7979
JsonRpcProcessor.Process(async);
80+
81+
async = new JsonRpcStateAsync(rpcResultHandler, null);
82+
async.JsonRpc = "{'method':'addInt','params':[1,7],'id':2}";
83+
JsonRpcProcessor.Process(async);
84+
85+
async = new JsonRpcStateAsync(rpcResultHandler, null);
86+
async.JsonRpc = "{'method':'NullableFloatToNullableFloat','params':[1.23],'id':3}";
87+
JsonRpcProcessor.Process(async);
88+
89+
async = new JsonRpcStateAsync(rpcResultHandler, null);
90+
async.JsonRpc = "{'method':'Test2','params':[3.456],'id':4}";
91+
JsonRpcProcessor.Process(async);
92+
93+
async = new JsonRpcStateAsync(rpcResultHandler, null);
94+
async.JsonRpc = "{'method':'StringMe','params':['Foo'],'id':5}";
95+
JsonRpcProcessor.Process(async);
8096
}
8197
are.WaitOne();
8298
}

TestServer_Console/service.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ private double add(double l, double r)
1414
return l + r;
1515
}
1616

17+
[JsonRpcMethod]
18+
private int addInt(int l, int r)
19+
{
20+
return l + r;
21+
}
22+
1723
[JsonRpcMethod]
1824
public float? NullableFloatToNullableFloat(float? a)
1925
{
@@ -25,5 +31,11 @@ private double add(double l, double r)
2531
{
2632
return x;
2733
}
34+
35+
[JsonRpcMethod]
36+
public string StringMe(string x)
37+
{
38+
return x;
39+
}
2840
}
2941
}

0 commit comments

Comments
 (0)