public void M_WillCopyRecordsToAnotherFile() { // Arrange var mock_source_file_io = new Mock <IFileIO <ExpectedIncomeRecord> >(); var source_records = new List <ExpectedIncomeRecord> { new ExpectedIncomeRecord { Description = "First record" }, new ExpectedIncomeRecord { Description = "Second record" } }; mock_source_file_io.Setup(x => x.Load(It.IsAny <List <string> >(), null)).Returns(source_records); var source_file = new CSVFile <ExpectedIncomeRecord>(mock_source_file_io.Object); source_file.Load(); var mock_target_file_io = new Mock <IFileIO <ExpectedIncomeRecord> >(); mock_target_file_io.Setup(x => x.Load(It.IsAny <List <string> >(), null)).Returns(new List <ExpectedIncomeRecord>()); var target_file = new CSVFile <ExpectedIncomeRecord>(mock_target_file_io.Object); target_file.Load(); Assert.AreEqual(0, target_file.Records.Count); // Act source_file.Copy_records_to_csv_file(target_file); // Assert Assert.AreEqual(source_file.Records.Count, target_file.Records.Count); Assert.AreEqual(source_file.Records[0].Description, target_file.Records[0].Description); Assert.AreEqual(source_file.Records[1].Description, target_file.Records[1].Description); }