public void StreamShouldBeReturnedZeroPosition() { var stream = "Dog,Cat\r\n1,2\r\n3,4.0".ToStream(); var testSubject = new DelimitedParserElector( stream); testSubject.Delimiter.DelimitedBy.Should().Be(','); stream.Position.Should().Be(0); }
public void ElectorShouldElectDelimiterAndHeader() { var stream = "Dog,Cat\r\n1,2\r\n3,4.0".ToStream(); var testSubject = new DelimitedParserElector( stream); testSubject.Delimiter.DelimitedBy.Should().Be(','); testSubject.Header.Count.Should().Be(2); testSubject.Header.DelimitedColumns[0].Name.Should().Be("Dog"); testSubject.Header.DelimitedColumns[1].Name.Should().Be("Cat"); testSubject.Header.DelimitedColumns[0].Type.Should().Be(typeof(int)); testSubject.Header.DelimitedColumns[1].Type.Should().Be(typeof(double)); }