Example #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"));
 }
        public void MissValueToNonOptionalParameterForOldClientVersionTest()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceWithParametersOldVersion>("TestServiceWithParameters", new TestServiceWithParameters());

            _service = startInfo.Item1;
            _service.Start();
            Assert.Throws <JRpcException>(() => startInfo.Item2.MethodWithParameters("smt"));
        }
        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"));
        }
Example #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;
        }
        public void CallMethodWithInterfaceInheritance()
        {
            var startInfo = ServiceRunner.StartService <ITestServiceImpl>("TestServiceImpl", new TestServiceImpl());

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

            Assert.AreEqual(TestService.STRING, startInfo.Item2.GetString());
        }
        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));
        }
        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));
        }
        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);
        }
        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();
        }
Example #13
0
 public void TestMethodWithOverridingByParams()
 {
     Assert.Throws <JRpcException>(
         () => ServiceRunner.StartService <ITestServiceImplWithOverridingByParams>("TestServiceImplWithOverridingByParams", new TestServiceImplWithOverridingByParams()));
 }