public void CreateThem() { var db = new TestDb(new SQLitePlatformWin32()); var foo = new Product { Name = "Foo", Price = 10.0m }; var bar = new Product { Name = "Bar", Price = 0.10m }; db.Insert(foo); db.Insert(bar); db.Insert(new OrderLine { ProductId = foo.Id, Quantity = 6, UnitPrice = 10.01m }); db.Insert(new OrderLine { ProductId = foo.Id, Quantity = 3, UnitPrice = 0.02m }); db.Insert(new OrderLine { ProductId = bar.Id, Quantity = 9, UnitPrice = 100.01m }); OrderLine[] lines = foo.GetOrderLines(); Assert.AreEqual(lines.Length, 2, "Has 2 order lines"); Assert.AreEqual(foo.Connection, db, "foo.Connection was set"); Assert.AreEqual(lines[0].Connection, db, "lines[0].Connection was set"); }
public void CreateThem() { var db = new TestDb(new SQLitePlatformTest()); var foo = new Product { Name = "Foo", Price = 10.0m }; var bar = new Product { Name = "Bar", Price = 0.10m }; db.Insert(foo); db.Insert(bar); db.Insert(new OrderLine { ProductId = foo.Id, Quantity = 6, UnitPrice = 10.01m }); db.Insert(new OrderLine { ProductId = foo.Id, Quantity = 3, UnitPrice = 0.02m }); db.Insert(new OrderLine { ProductId = bar.Id, Quantity = 9, UnitPrice = 100.01m }); OrderLine[] lines = foo.GetOrderLines(); Assert.AreEqual(lines.Length, 2, "Has 2 order lines"); Assert.AreEqual(foo.Connection, db, "foo.Connection was set"); Assert.AreEqual(lines[0].Connection, db, "lines[0].Connection was set"); }