コード例 #1
0
        public void two_confirmations_for_different_orders_are_not_equals()
        {
            Order o1 = new Order(1,
                                 BrokerDateTime.Make(DateTime.Now),
                                 "BP12345-RF-01",
                                 "RTS-9.13_FT",
                                 TradeAction.Buy,
                                 OrderType.Limit,
                                 10,
                                 136000,
                                 0);

            OrderDeliveryConfirmation c1 =
                new OrderDeliveryConfirmation(o1, BrokerDateTime.Make(DateTime.Now));

            Order o2 = new Order(2,
                                 BrokerDateTime.Make(DateTime.Now),
                                 "BP12345-RF-01",
                                 "RTS-9.13_FT",
                                 TradeAction.Sell,
                                 OrderType.Limit,
                                 10,
                                 136000,
                                 0);

            OrderDeliveryConfirmation c2 =
                new OrderDeliveryConfirmation(o2, BrokerDateTime.Make(DateTime.Now));

            EqualityComparer <OrderDeliveryConfirmation> ec =
                new OrderDeliveryConfirmationComparer();

            Assert.IsFalse(ec.Equals(c1, c2));
        }
コード例 #2
0
        public void two_confirmations_for_one_order_are_equals()
        {
            Order order = new Order(1,
                                    BrokerDateTime.Make(DateTime.Now),
                                    "BP12345-RF-01",
                                    "RTS-9.13_FT",
                                    TradeAction.Buy,
                                    OrderType.Limit,
                                    10,
                                    136000,
                                    0);

            OrderDeliveryConfirmation c1 =
                new OrderDeliveryConfirmation(order, BrokerDateTime.Make(DateTime.Now));

            OrderDeliveryConfirmation c2 =
                new OrderDeliveryConfirmation(order, BrokerDateTime.Make(DateTime.Now));

            EqualityComparer <OrderDeliveryConfirmation> ec =
                new OrderDeliveryConfirmationComparer();

            Assert.IsTrue(ec.Equals(c1, c2));
        }