public void SuccessfulyStart()
        {
            var serverEndpoint = new IntradomainEndpoint("1");
            var awaiter        = new IntradomainChannelAwaiter(serverEndpoint, new StringMessageSerializer(), ChannelSettings.GetDefault());

            awaiter.Start();

            Assert.That(awaiter.Active);
        }
Пример #2
0
        public void SuccessfulyOpen()
        {
            var listenterEndpoint = new IntradomainEndpoint("1");
            var awaiter           = new IntradomainChannelAwaiter(listenterEndpoint, new StringMessageSerializer(), ChannelSettings.GetDefault());

            awaiter.Start();

            var task = Task.Run(() => { awaiter.AwaitNewChannel(); });

            var channel = new IntradomainChannel(new IntradomainEndpoint("1"), new StringMessageSerializer(), null, null);

            channel.Open();

            task.Wait();

            Assert.That(channel.IsOpened);
        }
Пример #3
0
        public void SuccessfulyTransmitMessage()
        {
            var listenterEndpoint = new IntradomainEndpoint("1");
            var awaiter           = new IntradomainChannelAwaiter(listenterEndpoint, new StringMessageSerializer(), ChannelSettings.GetDefault());

            awaiter.Start();

            IChannel server = null;
            var      task   = Task.Run(() => { server = awaiter.AwaitNewChannel(); });

            var channel = new IntradomainChannel(new IntradomainEndpoint("1"), new StringMessageSerializer(), null);

            channel.Open();

            task.Wait();

            var message = new StringMessage("message");

            channel.Send(message);
            var receivedMessage = (StringMessage)server.Receive();

            Assert.That(receivedMessage.Message, Is.EqualTo(message.Message));
        }