public void ReadRecord_TwoRecordsInFile_ReturnsTwoRecordObjects() { // Arrange String resourceFileName = "Siftan.IntegrationTests.Resources.TestFile.csv"; String inputFilePath = this.workingDirectory + resourceFileName; Assembly.GetExecutingAssembly().CopyEmbeddedResourceToFile(resourceFileName, inputFilePath); var recordDescriptor = new DelimitedRecordDescriptor { Delimiter = "|", Qualifier = '\0', LineIDIndex = 0, HeaderID = "01", Term = new DelimitedRecordDescriptor.TermDefinition("01", 3) }; var reader = new DelimitedRecordReader(recordDescriptor); var fileReader = new FileReader(inputFilePath); // Act var firstRecord = reader.ReadRecord(fileReader); Int64 firstRecordEndPosition = fileReader.Position; var secondRecord = reader.ReadRecord(fileReader); Int64 secondRecordEndPosition = fileReader.Position; fileReader.Close(); // Assert firstRecord.Should().NotBeNull(); secondRecord.Should().NotBeNull(); firstRecord.Should().NotBeSameAs(secondRecord); firstRecord.Start.Should().Be(0); firstRecord.End.Should().Be(firstRecordEndPosition); secondRecord.Start.Should().Be(firstRecordEndPosition); secondRecord.End.Should().Be(secondRecordEndPosition); }