Пример #1
0
        public void GivenEncodedTag_Build_CreatesMessageWithTag()
        {
            var uut   = new MessageBuilder();
            var bytes = uut.AddTag(22, "tést", MessageEncoding.UTF8).Build();

            Assert.True(ConverterTestHelper.GetEncodedMessage("8=FIX.4.4|9=9|22=", Encoding.UTF8.GetBytes("tést"), "|10=058|").SequenceEqual(bytes));
        }
Пример #2
0
        public void GivenTwoAddTagAddRaw_Build_CreatesMessageWithTag()
        {
            var uut   = new MessageBuilder();
            var bytes = uut.AddRaw("22=test|23=test2|").Build();

            Assert.True(ConverterTestHelper.GetEncodedMessage("8=FIX.4.4|9=17|22=test|23=test2|10=247|").SequenceEqual(bytes));
        }
Пример #3
0
        public void GivenStringTag_Build_CreatesMessageWithTag()
        {
            var uut   = new MessageBuilder();
            var bytes = uut.AddTag("22=test|").Build();

            Assert.True(ConverterTestHelper.GetEncodedMessage("8=FIX.4.4|9=8|22=test|10=050|").SequenceEqual(bytes));
        }
Пример #4
0
        public void GivenBeginString_Build_CreatesMessageWithTag()
        {
            var uut   = new MessageBuilder();
            var bytes = uut.AddBeginString(SupportedFixVersion.Fix42).AddTag(22, "test").Build();

            Assert.True(ConverterTestHelper.GetEncodedMessage("8=FIX.4.2|9=8|22=test|10=048|").SequenceEqual(bytes));
        }
        public void GivenRawString_Get_EncodesByteArray()
        {
            var uut = new FixTagValueConverter();

            byte[] into = new byte[6];
            uut.Get("9=123|", into);
            Assert.True(ConverterTestHelper.GetEncodedMessage("9=123|").SequenceEqual(into));
        }
        public void GivenDouble_Get_EncodesByteArray()
        {
            var uut = new FixTagValueConverter();

            byte[] into = new byte[7];
            uut.Get(9, 67.8, into);
            Assert.True(ConverterTestHelper.GetEncodedMessage("9=67.8|").SequenceEqual(into));
        }
        public void GivenIntFixedLength_Get_EncodesByteArray()
        {
            var uut = new FixTagValueConverter();

            byte[] into = new byte[6];
            uut.Get(9, 1, into, 3);
            Assert.True(ConverterTestHelper.GetEncodedMessage("9=001|").SequenceEqual(into));
        }
        public void GivenEncodingString_Get_EncodesByteArray()
        {
            var uut = new FixTagValueConverter();

            byte[] into = new byte[8];
            uut.Get(9, "tést", MessageEncoding.UTF8, into);
            Assert.True(ConverterTestHelper.GetEncodedMessage("9=t", Encoding.UTF8.GetBytes("é"), "st|").SequenceEqual(into));
        }
Пример #9
0
        public void GivenInvalidTwoAddTagAddRaw_Build_CreatesMessageWithTag()
        {
            var    uut   = new MessageBuilder();
            string raw   = "35=8|49=PHLX|56=PERS|52=20071123-05:30:00.000|11=ATOMNOCCC9990900|20=3|150=E|39=E|55=MSFT|167=CS|54=1|38=15|40=2|44=15|58=PHLX EQUITY TESTING|59=0|47=C|32=0|31=0|151=15|14=0|6=0|35=8|49=PHLX|56=PERS|52=20071123-05:30:00.000|11=ATOMNOCCC9990900|20=3|150=E|39=E|55=MSFT|167=CS|54=1|38=15|40=2|44=15|58=PHLX EQUITY TESTING|59=0|47=C|32=0|31=0|151=15|14=0|6=0|";
            var    bytes = uut.AddRaw(raw).Build();

            Assert.True(ConverterTestHelper.GetEncodedMessage($"8=FIX.4.4|9=356|{raw}10=202|").SequenceEqual(bytes));
        }