public void Init() { var mockFactory = new MockRepository(MockBehavior.Loose) { CallBase = true }; m_importedProjectMetadataManagerMock = mockFactory.Create <ImportedProjectMetadataManager>(new object[1]); m_importHistoryManagerMock = mockFactory.Create <ImportHistoryManager>(new object[1]); m_importedProjectMetadataManagerMock.Setup(x => x.GetImportedProjectMetadataByExternalId(It.IsAny <string>())). Returns(new ImportedProjectMetadata { ExternalId = "1", Project = new Project { Id = 1 } }); m_filteringManager = new FilteringManager(m_importedProjectMetadataManagerMock.Object, m_importHistoryManagerMock.Object); var parserMock = new Mock <IProjectParser>(); parserMock.Setup(x => x.GetPairKeyValueList(It.IsAny <ImportedRecord>())).Returns(new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("100a", "Èapek, Karel"), new KeyValuePair <string, string>("100a", "Hus, Jan,") }); m_parser = parserMock.Object; m_importedRecord = new ImportedRecord(); }