public void TestDatabaseUpdate_AddsNewMembers() { InitialImportDatabase(); // Import updated database, where a member is removed and a new one is added IDatabaseImporter import = new CowImport(); import.Import(_02_updateDatabase, _handler.Database); // membercount should be the same since one new member is added Assert.AreEqual(3, _handler.Database.MemberSet.AsEnumerable().Where(m => m.IsMember()).Count()); Assert.AreEqual(4, _handler.Database.ChangelogSet.AsEnumerable(). Where(c => c.action.Equals(DBConstants.NewMember)).Count()); }
public void TestDatabaseUpdate_MovesDeletedUsersToNonMemberTable() { InitialImportDatabase(); // Import updated database, where a member is removed IDatabaseImporter import = new CowImport(); import.Import(_02_updateDatabase, _handler.Database); // one changelog entry should have been created and // one member should now be a resigned member Assert.AreEqual(1, _handler.Database.ChangelogSet.AsEnumerable(). Where(c => c.action.Equals(DBConstants.NewNonMember)).Count()); Assert.AreEqual(1, _handler.Database.MemberSet.AsEnumerable().Where(m => !m.IsMember()).Count()); }
public void TestInitialDatabaseImport_CreatesChangelogEntriesForNewContacts() { IDatabaseImporter import = new CowImport(); import.Import(_01_importDatabase, _handler.Database); Assert.AreEqual(3, _handler.Database.ChangelogSet.Count()); Assert.AreEqual(3, _handler.Database.ChangelogSet.AsEnumerable(). Where(c => c.action.Equals(DBConstants.NewMember)).Count()); }
private void InitialImportDatabase() { // Import the initial database IDatabaseImporter import = new CowImport(); import.Import(_01_importDatabase, _handler.Database); Assert.AreEqual(3, _handler.Database.MemberSet.AsEnumerable().Count()); }
public void TestDatabaseUpdate_PaymentStatus() { InitialImportDatabase(); IDatabaseImporter import = new CowImport(); import.Import(_03_importPaymentStatus, _handler.Database); }