예제 #1
0
        private ContactReader GetContactReaderFromSingleDatabaseRow(ContactDatabaseRow row)
        {
            MockContactDatabaseReader mockReader = new MockContactDatabaseReader();

            mockReader.AddRow(row);
            ContactReader contactReader = new ContactReader();

            contactReader.ParseDatabase(mockReader);

            return(contactReader);
        }
예제 #2
0
        public void VerifyDatabaseRowsMatchContacts(List <ContactDatabaseRow> inputRows, List <IContact> contactsExpected)
        {
            MockContactDatabaseReader mockReader = new MockContactDatabaseReader();

            foreach (ContactDatabaseRow row in inputRows)
            {
                mockReader.AddRow(row);
            }
            ContactReader contactReader = new ContactReader();

            contactReader.ParseDatabase(mockReader);
            List <IContact> contactsActual = new List <IContact>(contactReader);

            Assert.AreEqual(contactsExpected.Count, contactsActual.Count);
            foreach (IContact contactExpected in contactsExpected)
            {
                Assert.IsTrue(contactsActual.Contains(contactExpected));
            }
        }