public void TestCreateOrderSysTx() { var placedDate = DateTime.Now; var supplier = context.Suppliers.First(); var order = new Order() { PartTypeId = supplier.PartTypeId, SupplierId = supplier.Id, PartCount = 10, PlacedDate = placedDate }; Assert.Throws <NullReferenceException>(() => context.CreateOrderSysTx(order)); var command = new SqliteCommand( @"SELECT Count(*) FROM [Order] WHERE SupplierId=@supplierId AND PartTypeId=@partTypeId AND PlacedDate=@placedDate AND PartCount=10 AND FulfilledDate IS NULL", fixture.Connection); AddParameter(command, "@supplierId", supplier.Id); AddParameter(command, "@partTypeId", supplier.PartTypeId); AddParameter(command, "@placedDate", placedDate); Assert.Equal(0, (long)command.ExecuteScalar()); }