Ejemplo n.º 1
0
        public void GlueConfiguredByCodeAndMakeCall_Sync()
        {
            //This is an example of how to use Glue without pre-configured app container
            var app = new TestApplication()
            {
                Active = true
            };
            var glue = new NFX.Glue.Implementation.GlueService(app);

            glue.Start();
            try
            {
                using (var binding = new SyncBinding(glue, "sync"))
                {
                    binding.Start();
                    var cl = new JokeContractClient(glue, TestServerSyncNode);
                    cl.Headers.Add(new AuthenticationHeader(TestCredentials));

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

                    Assert.IsTrue(result.StartsWith("Server echoed Gello A!"));
                }
            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }
Ejemplo n.º 2
0
 public void GlueConfiguredByCode()
 {
     //This is an example of how to use Glue without pre-configured app container
     var glue = new NFX.Glue.Implementation.GlueService();
     glue.Start();
     try
     {
         var binding = new SyncBinding(glue, "sync");
         var cl = new JokeContractClient(glue, TestServerSyncNode);
     }
     finally
     {
         glue.WaitForCompleteStop();
     }
 }
Ejemplo n.º 3
0
        public void GlueConfiguredByCode_MPX()
        {
            //This is an example of how to use Glue without pre-configured app container
            var glue = new NFX.Glue.Implementation.GlueService();

            glue.Start();
            try
            {
                var binding = new MpxBinding(glue, "mpx");
                var cl      = new JokeContractClient(glue, TestServerMpxNode);
            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }
Ejemplo n.º 4
0
        public void GlueConfiguredByCodeAndMakeCall_Sync()
        {
            //This is an example of how to use Glue without pre-configured app container
            var app = new TestApplication(){ Active = true };
            var glue = new NFX.Glue.Implementation.GlueService(app);
            glue.Start();
            try
            {
                using(var binding = new SyncBinding(glue, "sync"))
                {
                  binding.Start();
                  var cl = new JokeContractClient(glue, TestServerSyncNode);
                  cl.Headers.Add( new AuthenticationHeader( TestCredentials ) );

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

                  Assert.IsTrue(result.StartsWith("Server echoed Gello A!"));
                }
            }
            finally
            {
                glue.WaitForCompleteStop();
            }
        }