Exemple #1
0
        public void ShouldUpdate()
        {
            using (var context = new AmfMoneyContext(_options))
            {
                context.Add(new Trade()
                {
                    OperationType = 'B'
                });

                context.SaveChanges();
            }

            using (var context = new AmfMoneyContext(_options))
            {
                var service = new TradeService(context);
                var trade   = context.Find <Trade>(1);
                trade.OperationType = 'S';
                service.Update(trade);
            }

            using (var context = new AmfMoneyContext(_options))
            {
                var trade = context.Find <Trade>(1);
                Assert.Equal('S', trade.OperationType);
            }
        }