Пример #1
0
        public void MPX_JokeContract_Expected_Security_Exception()
        {
            using (JokeHelper.MakeApp())
            {
                var cl = new JokeContractClient(TestServerMpxNode);

                var result = cl.Echo("Blah");//throws sec exception
            }
        }
Пример #2
0
        public void ExceptionBeforeInit()
        {
            using (JokeHelper.MakeApp())
            {
                var cl = new JokeCalculatorClient(TestServerSyncNode);
                cl.Headers.Add(new NFX.Glue.Protocol.AuthenticationHeader(TestCredentials));

                int result = cl.Add(1);
            }
        }
Пример #3
0
        public void MPX_JokeContract_Echo_ByCode()
        {
            using (JokeHelper.MakeApp())
            {
                var cl = new JokeContractClient(TestServerMpxNode);
                cl.Headers.Add(new AuthenticationHeader(TestCredentials));

                var result = cl.Echo("Gello A!");

                Aver.IsTrue(result.StartsWith("Server echoed Gello A!"));
            }
        }
Пример #4
0
        public void Sync_JokeContract_Async_Echo_ByCode()
        {
            using (JokeHelper.MakeApp())
            {
                var cl = new JokeContractClient(TestServerSyncNode);
                cl.Headers.Add(new AuthenticationHeader(TestCredentials));

                var call = cl.Async_Echo("Gello B!");

                var result = call.GetValue <string>();

                Aver.IsTrue(result.StartsWith("Server echoed Gello B!"));
            }
        }
Пример #5
0
        public void Sync_JokeCalculator_TestAdd()
        {
            using (JokeHelper.MakeApp())
            {
                var cl = new JokeCalculatorClient(TestServerSyncNode);
                cl.Headers.Add(new NFX.Glue.Protocol.AuthenticationHeader(TestCredentials));

                using (Scope.OnExit(() => cl.Done()))
                {
                    cl.Init(0);
                    cl.Add(10);
                    int result = cl.Sub(3);

                    Aver.AreEqual(7, result);
                }
            }
        }