public void can_read_data()
        {
            var discoverFactory = new Mock <IDiscoverFieldDefFactory>();

            discoverFactory.Setup(x => x.GetDiscoverStrategy(It.IsAny <DiscoverStrategy>()))
            .Returns(new FieldDefParserStrategy());

            var settings = Options.Create(new Template {
                DiscoverStrategy = DiscoverStrategy.FieldDefDescriptor,
                TableName        = "MyTable"
            });
            var sut = new TestSource(settings, NullLogger <SourceTest> .Instance, discoverFactory.Object, SampleData.ReadData());

            sut.Load("imput filename");
            bool more = sut.Read();

            Assert.True(more);
            Assert.Equal(1, sut.AsNumber(0));
            Assert.True(sut.AsBoolean(2));
            Assert.Null(sut.AsString(3));
            Assert.Equal(new DateTime(1970, 2, 24), sut.AsDateTime(4));

            more = sut.Read();
            Assert.True(more);

            more = sut.Read();
            Assert.False(more);
        }
        public void must_be_loaded_before_read_data()
        {
            var discoverFactory = new Mock <IDiscoverFieldDefFactory>();

            discoverFactory.Setup(x => x.GetDiscoverStrategy(It.IsAny <DiscoverStrategy>()))
            .Returns(new FieldDefParserStrategy());

            var settings = Options.Create(new Template {
                DiscoverStrategy = DiscoverStrategy.FieldDefDescriptor,
                TableName        = "MyTable"
            });
            var sut = new TestSource(settings, NullLogger <SourceTest> .Instance, discoverFactory.Object, SampleData.FieldDescriptorData());

            Assert.Throws <InvalidOperationException>(() => sut.Read());
        }