public void IUpdateableBiggyStore_Deletes_Many_Records() { _updateableStore = new SqlCeStore <Client>(_connectionStringName) as IUpdateableBiggyStore <Client>; var insertThese = new List <Client>(); for (int i = 0; i < 10; i++) { var newClient = new Client() { LastName = string.Format("LastName {0}", i), FirstName = "John", Email = "*****@*****.**" }; insertThese.Add(newClient); } _updateableStore.Add(insertThese); var newClients = _updateableStore.Load(); _updateableStore.Remove(newClients); newClients = _updateableStore.Load(); Assert.True(newClients.Count == 0); }
public void IUpdateableBiggyStore_Deletes_Record() { _updateableStore = new SqlCeStore <Client>(_connectionStringName) as IUpdateableBiggyStore <Client>; var newClient = new Client() { LastName = "Atten", FirstName = "John", Email = "*****@*****.**" }; _updateableStore.Add(newClient); // Stow the id so we can reload, then update (just to be SURE!!) int idToFind = newClient.ClientId; newClient = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); var deleteMe = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); _updateableStore.Remove(deleteMe); var clients = _updateableStore.Load(); Assert.True(clients.Count == 0); }
public void IUpdateableBiggyStore_Updates_Record() { _updateableStore = new SqlCeStore <Client>(_connectionStringName) as IUpdateableBiggyStore <Client>; var newClient = new Client() { LastName = "Atten", FirstName = "John", Email = "*****@*****.**" }; _updateableStore.Add(newClient); // Stow the id so we can reload, then update (just to be SURE!!) int idToFind = newClient.ClientId; newClient = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); newClient.FirstName = "John Paul"; newClient.LastName = "Jones"; _updateableStore.Update(newClient); var updatedClient = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); Assert.True(updatedClient.LastName == "Jones"); }
public void IUpdateableBiggyStore_Deletes_Many_Records() { _updateableStore = new PGStore<Client>(_connectionStringName) as IUpdateableBiggyStore<Client>; var insertThese = new List<Client>(); for (int i = 0; i < 10; i++) { var newClient = new Client() { LastName = string.Format("LastName {0}", i), FirstName = "John", Email = "*****@*****.**" }; insertThese.Add(newClient); } _updateableStore.Add(insertThese); var newClients = _updateableStore.Load(); _updateableStore.Remove(newClients); newClients = _updateableStore.Load(); Assert.True(newClients.Count == 0); }
public void IUpdateableBiggyStore_Updates_Record() { _updateableStore = new PGStore<Client>(_connectionStringName) as IUpdateableBiggyStore<Client>; var newClient = new Client() { LastName = "Atten", FirstName = "John", Email = "*****@*****.**" }; _updateableStore.Add(newClient); // Stow the id so we can reload, then update (just to be SURE!!) int idToFind = newClient.ClientId; newClient = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); newClient.FirstName = "John Paul"; newClient.LastName = "Jones"; _updateableStore.Update(newClient); var updatedClient = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); Assert.True(updatedClient.LastName == "Jones"); }
public void IUpdateableBiggyStore_Deletes_Record() { _updateableStore = new PGStore<Client>(_connectionStringName) as IUpdateableBiggyStore<Client>; var newClient = new Client() { LastName = "Atten", FirstName = "John", Email = "*****@*****.**" }; _updateableStore.Add(newClient); // Stow the id so we can reload, then update (just to be SURE!!) int idToFind = newClient.ClientId; newClient = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); var deleteMe = _updateableStore.Load().FirstOrDefault(c => c.ClientId == idToFind); _updateableStore.Remove(deleteMe); var clients = _updateableStore.Load(); Assert.True(clients.Count == 0); }