public void DispatchReflection_ServiceShouldBeCalledWithVariousDataTypes() { DataTypeTest dataTypeTest = new DataTypeTest("StringValue", 1L, 2.2f, 3.3d, new string[] { "1", "2", "3" }, new long[] { 1, 2, 3 }, new List <string>() { "1", "2", "3" }, new List <long>() { 1, 2, 3 }, new Dictionary <string, string>() { { "Key1", "Value1" }, { "Key2", "Value2" } }); ServiceDispatcher serviceDispatcher = new ServiceDispatcher(new TestPlatformProvider()); serviceDispatcher.Initialize(); Service1 service1 = new Service1(); serviceDispatcher.Subscribe <IService1>(service1); serviceDispatcher.Dispatch("service1", "serviceMethod4", new object[] { dataTypeTest.StringValue, dataTypeTest.LongValue, dataTypeTest.FloatValue, dataTypeTest.DoubleValue, dataTypeTest.StringArray, dataTypeTest.LongArray, dataTypeTest.StringEnumerable, dataTypeTest.LongEnumerable, dataTypeTest.StringDictionary }); Assert.Equal(dataTypeTest, service1.ServiceMethod4Result); }
public void ServiceMethod4(string stringValue, long longValue, float floatValue, double doubleValue, string[] stringArray, long[] longArray, IEnumerable <string> stringEnumerable, IEnumerable <long> longEnumerable, IDictionary <string, string> stringDictionary) { ServiceMethod4Result = new DataTypeTest(stringValue, longValue, floatValue, doubleValue, stringArray, longArray, stringEnumerable, longEnumerable, stringDictionary); }