Beispiel #1
0
        public void TestCustomerFieldGetMessage()
        {
            var actual   = new CustomerFieldGetMessage();
            var expected = new ClientMessageSerializer().Deserialize <CustomerFieldGetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #2
0
        public void TestInstrumentGroupParametersSetMessage()
        {
            var actual = new InstrumentGroupParametersSetMessage
            {
                Parameters = new Parameters {
                    CustomMinVolume = 1000, IsConsolidatedContract = true
                },
                AdditionalData                  = false,
                BaseContract                    = 101,
                AssetType                       = AssetType.Equities,
                Currency                        = "USD",
                CustomerUniqueIdPattern         = "CustomerUniqueId",
                EnforcedCustomerUniqueIdPattern = "EnforcedCustomerUniqueId",
                ExpiryDateStart                 = new DateTime(2017, 12, 24),
                ExpiryDateEnd                   = new DateTime(2018, 12, 24),
                IsinCodePattern                 = "AU12345",
                Symbol            = "SYMBL",
                Exchange          = "ASX",
                Issuer            = "Issuer",
                Kind              = "Barrier down and in Call",
                Market            = "ASX",
                StrikePriceMax    = 26,
                StrikePriceMin    = 6,
                UnderlyingPattern = "BHP",
                DateChangedFrom   = new DateTime(2000, 1, 1),
                DateChangedTo     = new DateTime(2015, 1, 1),
                TimeChangedFrom   = new TimeSpan(0, 0, 0),
                TimeChangedTo     = new TimeSpan(11, 59, 59)
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentGroupParametersSetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #3
0
        public void TestCalendarDownloadMessage()
        {
            var actual   = new CalendarDownloadMessage();
            var expected = new ClientMessageSerializer().Deserialize <CalendarDownloadMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #4
0
        public void TestCustomerValueGetMessage()
        {
            var actual = new CustomerValueGetMessage {
                CustomerId = "280781", FieldName = "CustomerAddress"
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerValueGetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #5
0
        public void TestEnumMessage()
        {
            var actual = new EnumGetMessage {
                Type = EnumType.Market
            };
            var expected = new ClientMessageSerializer().Deserialize <EnumGetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #6
0
        public void TestCustomerValueSearchMessage()
        {
            var actual = new CustomerValueSearchMessage {
                CustomerId = "280781", FieldName = "CustomerAddress", Value = "Sydney", SearchMode = SearchMode.Equal
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerValueSearchMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #7
0
        public void TestLogoutMessage()
        {
            var actual = new LogoutMessage {
                SuppressReply = SuppressReply.All
            };
            var expected = new ClientMessageSerializer().Deserialize <LogoutMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #8
0
        public void TestCalendarSetDefaultMessage()
        {
            var actual = new CalendarSetDefaultMessage {
                Calendar = "AsxTrading"
            };
            var expected = new ClientMessageSerializer().Deserialize <CalendarSetDefaultMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #9
0
        public void TestCounterpartAddMessage()
        {
            var actual = new CounterpartAddMessage {
                Counterpart = "J.P.Morgan"
            };
            var expected = new ClientMessageSerializer().Deserialize <CounterpartAddMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #10
0
        public void TestCustomerFieldInsertMessage()
        {
            var actual = new CustomerFieldInsertMessage {
                FieldName = "CustomerAddress", Locked = true, Order = 1
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerFieldInsertMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #11
0
        public void TestCustomerFieldUpdateMessage()
        {
            var actual = new CustomerFieldUpdateMessage {
                FieldName = "OldName", NewFieldName = "NewName", Order = 1
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerFieldUpdateMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #12
0
        public void TestCurrencyCreateMessage()
        {
            var actual = new CurrencyCreateMessage {
                Currency = "USD"
            };
            var expected = new ClientMessageSerializer().Deserialize <CurrencyCreateMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #13
0
        public void TestCustomerPortfolioGetMessage()
        {
            var actual = new CustomerPortfolioGetMessage {
                CustomerId = "280781", PortfolioName = "Port1"
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerPortfolioGetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #14
0
        public void TestCustomerUpdateMessage()
        {
            var actual = new CustomerUpdateMessage {
                CustomerId = "280781", NewCustomerId = "280782"
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerUpdateMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #15
0
        public void TestLoginMessage()
        {
            var actual = new LoginMessage {
                LoginId = "mithun", Password = "******", AllowPing = true, PingInterval = 30, PingTimeout = 30
            };
            var expected = new ClientMessageSerializer().Deserialize <LoginMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #16
0
        public void TestInstrumentCleanupExpiredMessage()
        {
            var actual = new InstrumentCleanupExpiredMessage {
                ExpiryDate = new DateTime(2015, 12, 25)
            };
            var expected = new ClientMessageSerializer().Deserialize <InstrumentCleanupExpiredMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #17
0
        public void TestCustomerGetMessage()
        {
            var actual = new CustomerGetMessage {
                CustomerIdPattern = "280781", IgnoreCase = false
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerGetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #18
0
        public void TestCustomerFieldDeleteMessage()
        {
            var actual = new CustomerFieldDeleteMessage {
                FieldName = "CustomerAddress"
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerFieldDeleteMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #19
0
        public void TestDividendDeleteMessage()
        {
            var actual = new DividendDeleteMessage {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX"
                }
            };
            var expected = new ClientMessageSerializer().Deserialize <DividendDeleteMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #20
0
        public void TestInstrumentSetAsPreferredMessage()
        {
            var actual = new InstrumentSetAsPreferredMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub1"
                }
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentSetAsPreferredMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #21
0
        public void TestInstrumentDynamicParameterDeleteMessage()
        {
            var actual = new InstrumentDynamicParameterDeleteMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub"
                },
                Name = "dynamo"
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentDynamicParameterDeleteMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #22
0
        public void TestInstrumentDeleteMessage()
        {
            var actual = new InstrumentDeleteMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub"
                },
                ErrorIfBaseContract = false
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentDeleteMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #23
0
        public void TestInstrumentGetMessage()
        {
            var actual = new InstrumentGetMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub"
                },
                WithOrcDescription = true
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentGetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #24
0
        public void TestDividendGetMessage()
        {
            var actual = new DividendGetMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub"
                },
                DividendKinds = new DividendKinds {
                    DividendKind.SpotRelative, DividendKind.ConvertibleCallDate, DividendKind.FloatingNegative
                }
            };
            var expected = new ClientMessageSerializer().Deserialize <DividendGetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #25
0
        public void TestDividendInsertMessage()
        {
            var actual = new DividendInsertMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub"
                },
                Dividend = new Dividend {
                    Amount = 1500, DividendDate = new DateTime(1981, 7, 28), ExDividendDate = new DateTime(1981, 7, 17)
                }
            };
            var expected = new ClientMessageSerializer().Deserialize <DividendInsertMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #26
0
        public void TestInstrumentParametersSetMessage()
        {
            var actual = new InstrumentParametersSetMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub1"
                },
                Parameters = new Parameters {
                    CustomMinVolume = 1000, IsConsolidatedContract = true, AutoDimingAskFlag = false
                }
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentParametersSetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #27
0
        public void TestInstrumentCreateMessage()
        {
            var actual = new InstrumentCreateMessage
            {
                InstrumentAttributes = new InstrumentAttributes {
                    AssetType = AssetType.InterestRate, ExpiryType = ExpiryType.American, Multiplier = 100, MaturityDate = new DateTime(2000, 11, 16)
                },
                Parameters = new Parameters {
                    CustomMinVolume = 1000, IsConsolidatedContract = true
                }
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentCreateMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #28
0
        public void TestInstrumentAttributesSetMessage()
        {
            var actual = new InstrumentAttributesSetMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub"
                },
                InstrumentAttributes = new InstrumentAttributes {
                    AssetType = AssetType.Equities, ExpiryType = ExpiryType.American, Multiplier = 100, MaturityDate = new DateTime(2000, 11, 16)
                }
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentAttributesSetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #29
0
        public void TestCustomerValueUpdateMessage()
        {
            var actual = new CustomerValueUpdateMessage {
                CustomerId = "280781", FieldNameValues = new FieldNameValues
                {
                    new FieldNameValue {
                        FieldName = "Name", Value = "Mithun"
                    },
                    new FieldNameValue {
                        FieldName = "City", Value = "Sydney"
                    }
                }
            };
            var expected = new ClientMessageSerializer().Deserialize <CustomerValueUpdateMessage>();

            Assert.IsTrue(expected.Match(actual));
        }
Beispiel #30
0
        public void TestInstrumentDynamicParameterSetMessage()
        {
            var actual = new InstrumentDynamicParametersSetMessage
            {
                InstrumentId = new InstrumentId {
                    Feedcode = "BHP", Market = "ASX", Submarket = "Sub"
                },
                DynamicParameters = new DynamicParameters {
                    new DynamicParameter {
                        Name = "dynamic", Value = "value"
                    }
                }
            };

            var expected = new ClientMessageSerializer().Deserialize <InstrumentDynamicParametersSetMessage>();

            Assert.IsTrue(expected.Match(actual));
        }