public void ReadById_ContactRecord_ExpectedContactRecordForProvidedContactId() { int contactId = 1; DataModel.Contact contact = new DataModel.Contact() { Id = 1, FirstName = "FirstName", LastName = "LastName", Type = new DataModel.ContactType() { Id = 1, Type = "PERSON" } }; mockContactRepository.Setup((item) => item.Read(contactId)).Returns( contact ); var contactRepository = new BusinessRepository.ContactRepository(mockLogger.Object, mockContactRepository.Object ); var result = contactRepository.Read(contactId); Assert.IsNotNull(result); Assert.IsTrue(result.FullName == GetFullName(contact)); Assert.IsTrue(result.ContactType == contact.Type.Id); }
public void ReadById_AddressRecord_ExpectedNoRecordsProvidedAddressId() { int contactId = 1; var contactRepository = new BusinessRepository.ContactRepository(mockLogger.Object, mockContactRepository.Object ); var result = contactRepository.Read(contactId); Assert.IsNull(result); }