public void Deletes_all_records_with_serial_id() { _db.TryDropTable("companydocuments"); var companyStore = new SqliteDocumentStore <CompanyDocuments>(_db); var myBatch = new List <CompanyDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new CompanyDocuments { Name = "Company Store #" + i, Address = i + " Company Parkway, Portland, OR 97204" }); } companyStore.Add(myBatch); // Re-load from back-end: var companies = companyStore.TryLoadData(); int qtyAdded = companies.Count; // Delete: companyStore.DeleteAll(); int remaining = companyStore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }
public void Deletes_all_records_with_string_id() { _db.TryDropTable("guitardocuments"); var guitarstore = new SqliteDocumentStore <GuitarDocuments>(_db); var myBatch = new List <GuitarDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new GuitarDocuments { Sku = "USA # " + i, Make = "Fender", Model = "Stratocaster" }); } guitarstore.Add(myBatch); // Re-load from back-end: var companies = guitarstore.TryLoadData(); int qtyAdded = companies.Count; // Delete: guitarstore.DeleteAll(); int remaining = guitarstore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }
public void Deletes_all_records_with_string_id() { _db.TryDropTable("instrumentdocuments"); var InstrumentStore = new SqliteDocumentStore <InstrumentDocuments>(_db); var myBatch = new List <InstrumentDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new InstrumentDocuments { Id = "USA #" + i, Category = "String # " + i, Type = "Guitar" }); } InstrumentStore.Add(myBatch); // Re-load from back-end: var companies = InstrumentStore.TryLoadData(); int qtyAdded = companies.Count; // Delete: InstrumentStore.DeleteAll(); int remaining = InstrumentStore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }
public void Deletes_all_records_with_int_id() { _db.TryDropTable("widgetdocuments"); var widgetstore = new SqliteDocumentStore <WidgetDocuments>(_db); var myBatch = new List <WidgetDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new WidgetDocuments { Identifier = i, Category = "Plastic # " + i }); } widgetstore.Add(myBatch); // Re-load from back-end: var companies = widgetstore.TryLoadData(); int qtyAdded = companies.Count; // Delete: widgetstore.DeleteAll(); int remaining = widgetstore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }
public void Deletes_all_records_with_string_id() { _db.TryDropTable("guitardocuments"); var guitarstore = new SqliteDocumentStore<GuitarDocuments>(_db); var myBatch = new List<GuitarDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new GuitarDocuments { Sku = "USA # " + i, Make = "Fender", Model = "Stratocaster" }); } guitarstore.Add(myBatch); // Re-load from back-end: var companies = guitarstore.TryLoadData(); int qtyAdded = companies.Count; // Delete: guitarstore.DeleteAll(); int remaining = guitarstore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }
public void Deletes_all_records_with_int_id() { _db.TryDropTable("widgetdocuments"); var widgetstore = new SqliteDocumentStore<WidgetDocuments>(_db); var myBatch = new List<WidgetDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new WidgetDocuments { Identifier = i, Category = "Plastic # " + i }); } widgetstore.Add(myBatch); // Re-load from back-end: var companies = widgetstore.TryLoadData(); int qtyAdded = companies.Count; // Delete: widgetstore.DeleteAll(); int remaining = widgetstore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }
public void Deletes_all_records_with_string_id() { _db.TryDropTable("instrumentdocuments"); var InstrumentStore = new SqliteDocumentStore<InstrumentDocuments>(_db); var myBatch = new List<InstrumentDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new InstrumentDocuments { Id = "USA #" + i, Category = "String # " + i, Type = "Guitar" }); } InstrumentStore.Add(myBatch); // Re-load from back-end: var companies = InstrumentStore.TryLoadData(); int qtyAdded = companies.Count; // Delete: InstrumentStore.DeleteAll(); int remaining = InstrumentStore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }
public void Deletes_all_records_with_serial_id() { _db.TryDropTable("companydocuments"); var companyStore = new SqliteDocumentStore<CompanyDocuments>(_db); var myBatch = new List<CompanyDocuments>(); int qtyToAdd = 10; for (int i = 0; i < qtyToAdd; i++) { myBatch.Add(new CompanyDocuments { Name = "Company Store #" + i, Address = i + " Company Parkway, Portland, OR 97204" }); } companyStore.Add(myBatch); // Re-load from back-end: var companies = companyStore.TryLoadData(); int qtyAdded = companies.Count; // Delete: companyStore.DeleteAll(); int remaining = companyStore.TryLoadData().Count; Assert.IsTrue(qtyAdded == qtyToAdd && remaining == 0); }