Exemplo n.º 1
0
        public void ConvertFixMessageToFixObject_ReturnsHeartbeatObject_ForHeartbeatMessage()
        {
            string message = "8=FIXT1.1\u00019=28\u000135=0\u000149=Client\u000156=Bank\u000134=1\u000110=253\u0001";

            BaseMessage result = new FixParser().ConvertFixMessageToFixObject(message);

            result.Should().BeOfType<HeartbeatMessage>();
            result.As<HeartbeatMessage>().SenderCompID.Should().Be("Client");
            result.As<HeartbeatMessage>().TargetCompID.Should().Be("Bank");
        }
Exemplo n.º 2
0
        public void ConvertFixMessageToFixObject_ReturnsLogonMessageObject_ForLogonMessage()
        {
            string message = "8=FIXT1.1\u00019=35\u000135=A\u000149=Client\u000156=Bank\u000134=1\u0001108=30\u000110=70\u0001";

            BaseMessage result = new FixParser().ConvertFixMessageToFixObject(message);

            result.Should().BeOfType<LogonMessage>();
            result.As<LogonMessage>().HeartBeatInterval.TotalSeconds.Should().Be(30);
            result.As<LogonMessage>().MessageSequenceNumber.Should().Be(1);
            result.As<LogonMessage>().SenderCompID.Should().Be("Client");
            result.As<LogonMessage>().TargetCompID.Should().Be("Bank");
        }
Exemplo n.º 3
0
        public void ConvertFixMessageToFixObject_ReturnsQuoteRequestObject_ForQuoteRequestMessage()
        {
            string message = "8=FIXT1.1\u00019=71\u000135=R\u000149=Client\u000156=Bank\u000134=7\u0001131=rfq712\u000155=USDJPY\u000110=171\u0001";

            BaseMessage result = new FixParser().ConvertFixMessageToFixObject(message);

            result.Should().BeOfType<QuoteRequestMessage>();
            result.As<QuoteRequestMessage>().SenderCompID.Should().Be("Client");
            result.As<QuoteRequestMessage>().TargetCompID.Should().Be("Bank");
            result.As<QuoteRequestMessage>().QuoteReqID.Should().Be("rfq712");
            result.As<QuoteRequestMessage>().Symbol.Should().Be("USDJPY");
        }
Exemplo n.º 4
0
        public void ConvertFixObjectToFixMessage_ReturnsCorrectString_ForTestRequestMessage()
        {
            var messageObject = new TestRequestMessage("Client", "Bank", 7, "Attempt1");

            string result = new FixParser().ConvertFixObjectToFixMessage(messageObject);

            string expected = "8=FIXT1.1\u00019=33\u000135=1\u000149=Client\u000156=Bank\u000134=7\u0001112=\u000110=210\u0001";

            result.Should().Be(expected);
        }
Exemplo n.º 5
0
        public void ConvertFixObjectToFixMessage_ReturnsCorrectString_ForQuoteMessage()
        {
            var messageObject = new QuoteMessage("Client", "Bank", 7, "rfq712", "q712", "USDJPY", 119.55);

            string result = new FixParser().ConvertFixObjectToFixMessage(messageObject);

            string expected = "8=FIXT1.1\u00019=71\u000135=S\u000149=Client\u000156=Bank\u000134=7\u0001131=rfq712\u0001117=q712\u000155=USDJPY\u0001133=119.5500\u000110=171\u0001";

            result.Should().Be(expected);
        }
Exemplo n.º 6
0
        public void ConvertFixObjectToFixMessage_ReturnsCorrectString_ForLogoutMessage()
        {
            var messageObject = new LogoutMessage("Client", "Bank", 1);

            string result = new FixParser().ConvertFixObjectToFixMessage(messageObject);

            string expected = "8=FIXT1.1\u00019=28\u000135=5\u000149=Client\u000156=Bank\u000134=1\u000110=2\u0001";

            result.Should().Be(expected);
        }
Exemplo n.º 7
0
        public void ConvertFixObjectToFixMessage_ReturnsCorrectString_ForLogonMessage()
        {
            var messageObject = new LogonMessage("Client", "Bank", 1,
                TimeSpan.FromSeconds(30));

            string result = new FixParser().ConvertFixObjectToFixMessage(messageObject);

            string expected = "8=FIXT1.1\u00019=35\u000135=A\u000149=Client\u000156=Bank\u000134=1\u0001108=30\u000110=70\u0001";

            result.Should().Be(expected);
        }