public void dispatches_to_method_with_overloads() { var p1 = Serialization.BuildParamTuple(typeof(string), "test"); var result = _dispatcher.Dispatch(serviceName, "Operation2", new ParamTuple[] { p1 }, new[] { "str" }); _service.Operation2Invoked.Should().BeTrue(); Assert.IsNotNull(result); Assert.IsNull(result.Item1); Assert.AreEqual(typeof(void), result.Item2); }
public void dispatches_to_method_with_return() { var p1 = Serialization.BuildParamTuple(typeof(int), 10); var p2 = Serialization.BuildParamTuple(typeof(int), 20); var result = _dispatcher.Dispatch(serviceName, "Add", new[] { p1, p2 }, new[] { "int32", "int32" }); _service.AddInvoked.Should().BeTrue(); Assert.IsNotNull(result); result.Item1.Should().Be(30); Assert.AreEqual(typeof(int), result.Item2); }