コード例 #1
0
        public void OrderSave()
        {
            var options = new DbContextOptionsBuilder <PersistentContext>()
                          .UseInMemoryDatabase(databaseName: "order_test")
                          .Options;

            // Run the test against one instance of the context
            var context         = new PersistentContext(options);
            var orderRepository = new OrderRepository(context);
            var queueService    = new QueueService();

            OrderService orderService = new OrderService(orderRepository, queueService);


            var order = new Order()
            {
                Id = 32322, Quantity = 2, Side = "buy", Symbol = "PETR4", Price = 11
            };

            queueService.AddOrderInQueue(order);
        }