Ejemplo n.º 1
0
        public void TestGettingUri_NoSystemEndpoint()
        {
            MockAdapterConnectionUri uri = new MockAdapterConnectionUri();

            uri.Host = "localhost";

            Uri resultUri = uri.Uri;
        }
Ejemplo n.º 2
0
        public void TestGettingUri_NoHost()
        {
            MockAdapterConnectionUri uri = new MockAdapterConnectionUri();

            uri.SystemEndpoint = "SomeEndpoint";
            uri.Operation      = "SomeOperation";

            Uri resultUri = uri.Uri;
        }
Ejemplo n.º 3
0
        public void TestGettingUri()
        {
            MockAdapterConnectionUri uri = new MockAdapterConnectionUri();

            uri.Host           = "localhost";
            uri.SystemEndpoint = "SomeEndpoint";

            Assert.AreEqual("mock://localhost/SomeEndpoint", uri.Uri.OriginalString, "The URI is not correct");
        }
Ejemplo n.º 4
0
        public void TestSettingUri_WithOperation()
        {
            MockAdapterConnectionUri uri = new MockAdapterConnectionUri();

            uri.Uri = new Uri("mock://localhost/SomeEndpoint/SomeOperation");

            Assert.AreEqual("localhost", uri.Host, "Host is not set properly");
            Assert.AreEqual("SomeEndpoint", uri.SystemEndpoint, "SystemEndpoing is not set properly");
            Assert.AreEqual("SomeOperation", uri.Operation, "Operation is not set properly");
        }
        public void MyTestInitialize()
        {
            //Setting up the inbound handler with all the references
            connectionUri    = new MockAdapterConnectionUri(new Uri("mock://localhost/TestEndpoint"));
            adapter          = new MockAdapter();
            adapter.Encoding = "UTF-8";
            MockAdapterConnectionFactory connectionFactory = new MockAdapterConnectionFactory(
                connectionUri, null, adapter);
            MockAdapterConnection connection = new MockAdapterConnection(connectionFactory);

            outboundHandler = new MockAdapterOutboundHandler(connection, null);
        }
Ejemplo n.º 6
0
        public void MyTestInitialize()
        {
            //Setting up the inbound handler with all the references
            connectionUri = new MockAdapterConnectionUri(
                new Uri(
                    string.Format("mock://localhost/2WayTestEndpoint{0}", endpointId++))
                );
            adapter          = new MockAdapter();
            adapter.Encoding = "UTF-8";
            MockAdapterConnectionFactory connectionFactory = new MockAdapterConnectionFactory(
                connectionUri, null, adapter);
            MockAdapterConnection connection = new MockAdapterConnection(connectionFactory);

            inboundHandler = new MockAdapterInboundHandler(connection, null);

            inboundHandler.StartListener(null, TimeSpan.FromMinutes(1));
        }
Ejemplo n.º 7
0
        private void InitInboundHandler(string address, string adapterProperties)
        {
            connectionUri    = new MockAdapterConnectionUri(new Uri(address));
            adapter          = new MockAdapter();
            adapter.Encoding = "UTF-8";

            if (!string.IsNullOrEmpty(adapterProperties))
            {
                adapter.PromotedProperties = adapterProperties;
            }

            MockAdapterConnectionFactory connectionFactory = new MockAdapterConnectionFactory(
                connectionUri, null, adapter);
            MockAdapterConnection connection = new MockAdapterConnection(connectionFactory);

            inboundHandler = new MockAdapterInboundHandler(connection, null);
        }
Ejemplo n.º 8
0
        public void MyTestInitialize()
        {
            // Setting up the inbound handler with all the references
            // Setting differnet URL for each test in order to avoid collisions
            // over the same pipe due to lagging clean up as it is usually
            // executed in the context of a different thread
            connectionUri = new MockAdapterConnectionUri(
                new Uri(
                    string.Format("mock://localhost/TestEndpoint{0}", endpointId++))
                );
            adapter          = new MockAdapter();
            adapter.Encoding = "UTF-8";
            MockAdapterConnectionFactory connectionFactory = new MockAdapterConnectionFactory(
                connectionUri, null, adapter);
            MockAdapterConnection connection = new MockAdapterConnection(connectionFactory);

            outboundHandler = new MockAdapterOutboundHandler(connection, null);
        }
Ejemplo n.º 9
0
        public void TestSettingUri_WrongScheme()
        {
            MockAdapterConnectionUri uri = new MockAdapterConnectionUri();

            uri.Uri = new Uri("mack://localhost/SomeEndpoint");
        }
Ejemplo n.º 10
0
        public void TestSettingUri_NoEndpoint()
        {
            MockAdapterConnectionUri uri = new MockAdapterConnectionUri();

            uri.Uri = new Uri("mock://localhost");
        }