/// <summary> /// Fetches the product collection. /// </summary> /// <returns></returns> private static ProductCollection FetchProductCollection() { ProductCollection c = new ProductCollection(); c.Load(ReadOnlyRecord <Product> .FetchByParameter(Product.Columns.ProductName, Comparison.Like, "Unit Test Product%")); return(c); }
public void Acc_BatchSaveInsert() { ProductCollection c = CreateProductCollection(); c.BatchSave(); c = new ProductCollection(); c.Load(ReadOnlyRecord <Product> .FetchByParameter(Product.Columns.ProductName, Comparison.Like, "Unit Test Product%")); Assert.AreEqual(1000, c.Count, "Expected 1000 - After Save: " + c.Count); }
public void Acc_DeferredDelete() { ProductCollection c = CreateProductCollection(); c.BatchSave(); c = new ProductCollection(); c.Load(ReadOnlyRecord <Product> .FetchByParameter(Product.Columns.ProductName, Comparison.Like, "Unit Test Product%")); Assert.AreEqual(1000, c.Count, "Expected 1000 - After Save: " + c.Count); while (c.Count > 0) { c.RemoveAt(0); // RemoveItem() gets called } c.SaveAll(); c = new ProductCollection(); c.Load(ReadOnlyRecord <Product> .FetchByParameter(Product.Columns.ProductName, Comparison.Like, "Unit Test Product%")); Assert.AreEqual(0, c.Count, "Expected 0 - After Save: " + c.Count); }