Exemplo n.º 1
0
        public void StartService()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceImpl>("TestServiceImpl", new TestServiceImpl());

            _service = startInfo.Item1;
            _client  = startInfo.Item2;
        }
 public void CallIntersectInterfaceMethod2()
 {
     Assert.Throws <JRpcException>(
         () =>
         ServiceRunner.StartService <ITestServiceWithInterfaceMethodIntersect>("TestServiceWithInterfaceMethodIntersect2",
                                                                               new TestServiceWithInterfaceMethodIntersect2(), port: "11111"));
 }
 public void CallIntersectInterfaceMethod()
 {
     Assert.Throws <JRpcException>(
         () =>
         ServiceRunner.StartService <ITestServiceWithInterfaceMethodIntersectAndParameterNameMismatch>("TestServiceWithInterfaceMethodIntersect",
                                                                                                       new TestServiceWithInterfaceMethodIntersect(), port: "11113"));
 }
Exemplo n.º 4
0
        public void MissValueToNonOptionalParameterForOldClientVersionTest()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParametersOldVersion>("TestServiceWithParameters", new TestServiceWithParameters());

            _service = startInfo.Item1;
            _service.Start();
            Assert.Throws <JRpcException>(() => startInfo.Item2.MethodWithParameters("smt"));
        }
Exemplo n.º 5
0
        public void MissValueToOptionalParameterForOldClientVersionTest()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParametersOldVersion>("TestServiceWithParameters", new TestServiceWithParameters());

            _service = startInfo.Item1;
            _service.Start();
            Assert.AreEqual(TestServiceWithParameters.DEFAULT_PARAMETER_VALUE, startInfo.Item2.MethodWithDefaulParameter("smt"));
        }
Exemplo n.º 6
0
        public void TestMethodWithNew()
        {
            var serviceInfo = ServiceRunner.StartService <ITestServiceImpl>("TestServiceImplWithOverriding", new TestServiceImplWithOverriding(), port: "9999");
            var client      = serviceInfo.Item2;

            Assert.AreEqual(TestServiceImplWithOverriding.IMPL_STRING, client.GetOverrideString());
            serviceInfo.Item1.Stop();
            client = null;
        }
Exemplo n.º 7
0
        public void CallMethodWithInterfaceInheritance()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceImpl>("TestServiceImpl", new TestServiceImpl());

            _service = startInfo.Item1;
            _service.Start();

            Assert.AreEqual(TestService.STRING, startInfo.Item2.GetString());
        }
Exemplo n.º 8
0
        public void CallMethodOnServiceWithMultipleInterfaces()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParamsNameMismatch2>("TestServiceWithParamsNameMismatch", new TestServiceWithParamsNameMismatch());

            _service = startInfo.Item1;
            _service.Start();
            var paramValue = "test";

            Assert.AreEqual(paramValue, startInfo.Item2.AnotherMethod(paramValue));
        }
Exemplo n.º 9
0
        public void CallMethodWithSchemeMismatchTest()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParamsNameMismatch>("TestServiceWithParamsNameMismatch", new TestServiceWithParamsNameMismatch());

            _service = startInfo.Item1;
            _service.Start();
            var paramValue = "test";

            Assert.AreEqual(paramValue, startInfo.Item2.Method(paramValue));
        }
Exemplo n.º 10
0
        public void MissValueToOptionalParameterForClientWithOtherDefaultTest()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParametersAndNewDefaultValue>("TestServiceWithParameters", new TestServiceWithParameters());

            _service = startInfo.Item1;
            _service.Start();
            var methodWithDefaulParameter = startInfo.Item2.MethodWithDefaulParameter("smt");

            Assert.AreEqual(TestServiceWithParameters.NEW_DEFAULT_PARAMETER_VALUE, methodWithDefaulParameter);
        }
Exemplo n.º 11
0
        public void PassValueToOptionalParameterTest()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParameters>("TestServiceWithParameters", new TestServiceWithParameters());

            _service = startInfo.Item1;
            _service.Start();
            var methodWithDefaulParameter = startInfo.Item2.MethodWithDefaulParameter("smt", TestData);

            Assert.AreEqual(TestData, methodWithDefaulParameter);
        }
        public void MissValueToOptionalParameterTest()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParameters>("TestServiceWithParameters", new TestServiceWithParameters(), port: "11119");
            var service   = startInfo.Item1;

            service.Start();
            var methodWithDefaulParameter = startInfo.Item2.MethodWithDefaulParameter("smt");

            Assert.AreEqual(TestServiceWithParameters.DEFAULT_PARAMETER_VALUE, methodWithDefaulParameter);
            service.Stop();
        }
Exemplo n.º 13
0
 public void TestMethodWithOverridingByParams()
 {
     Assert.Throws <JRpcException>(
         () => ServiceRunner.StartService <ITestServiceImplWithOverridingByParams>("TestServiceImplWithOverridingByParams", new TestServiceImplWithOverridingByParams()));
 }