Exemplo n.º 1
0
        public void MllpServer_Receives_Message_OML_O33_And_Delegates_It_To_A_Message_Handler_Which_Returns_A_Valid_ORL_O34_Message()
        {
            // Arrange
            OML_O33 omlO33 = this.CreateValidOmlO33Message();
            ORL_O34 orlO34 = this.CreateValidOrlO34Message();
            CancellationTokenSource source = new CancellationTokenSource();

            this.testee.Start();

            // Act
            ClientConnectionDetails connectionDetails = new ClientConnectionDetails(IPAddress.Loopback.ToString(), 8013);
            var client = (MllpClient)MllpClient.Create(connectionDetails).Result;
            var task   = client.Send(omlO33.ToString(), source.Token);

            task.Wait(5000, source.Token);

            string returnedValue = task.Result.Message;

            // Assert
            task.Status.Should().Be(TaskStatus.RanToCompletion);
            returnedValue.Should().NotBeNull("we must receive a ORL^O34^ORL_O34 message as response.");
            returnedValue.Should().Be(orlO34.ToString(), "this is the expected content of the response.");
        }
Exemplo n.º 2
0
        private ORL_O34 CreateValidOrlO34Message()
        {
            ORL_O34 message = new ORL_O34();

            return(message);
        }