コード例 #1
0
            public void AddOrder()
            {
                expectedOrder = new Order
                {
                    PhoneNumber = "0700000001",
                    Reference   = Guid.NewGuid(),
                    Status      = "New"
                };

                using (sut.BeginTransaction())
                    sut.Add(expectedOrder);

                var actual = sut.GetByReference(expectedOrder.Reference);

                actual.Should().BeEquivalentTo(expectedOrder, o => o.Excluding(x => x.CreatedAt).Excluding(x => x.Id));
            }
コード例 #2
0
        public void InsertOrder(Order order)
        {
            var options = Options.Create(new Config
            {
                ConnectionString = connectionString
            });

            sut = new OrdersDataStore(options);

            output.WriteLine($"Inserting Order with Reference={order.Reference}");

            using var tx = sut.BeginTransaction();
            sut.Add(order);

            orders.Add(order);
        }