public void GeoFileReader_ParsesFileCorrectly2()
        {
            var gf     = new GeoFileReader();
            var target = gf.ReadRecords <CustomEntity>(@"testdata\test_geofilereadercustom2.txt", new CustomParser(4, 0, new[] { '!' }, Encoding.UTF8, false)).ToArray();

            Assert.AreEqual(3, target.Length);
        }
        public void GeoFileReader_ParsesFileCorrectly1()
        {
            var gf     = new GeoFileReader();
            var target = gf.ReadRecords(@"testdata\test_geofilereadercustom1.txt", new CustomParser(9, 1, new[] { ',' }, Encoding.UTF8, true)).ToArray();

            Assert.AreEqual(2, target.Length);
        }
        public void GeoFileWriter_ComposesFileCorrectly2()
        {
            new GeoFileWriter().WriteRecords<CustomEntity>(@"testdata\test_geofilewritercustom2.txt", testvalues, new CustomComposer(Encoding.UTF7, '!'));

            var gf = new GeoFileReader();
            var target = gf.ReadRecords<CustomEntity>(@"testdata\test_geofilewritercustom2.txt", new CustomParser(3, 0, new[] { '!' }, Encoding.UTF7, false)).ToArray();
            Assert.AreEqual(3, target.Length);
            CollectionAssert.AreEqual(testvalues, target, new CustomEntityComparer());
        }
Exemple #4
0
        public void GeoFileWriter_ComposesFileCorrectly2()
        {
            new GeoFileWriter().WriteRecords <CustomEntity>(@"testdata\test_geofilewritercustom2.txt", testvalues, new CustomComposer(Encoding.UTF7, '!'));

            var gf     = new GeoFileReader();
            var target = gf.ReadRecords <CustomEntity>(@"testdata\test_geofilewritercustom2.txt", new CustomParser(3, 0, new[] { '!' }, Encoding.UTF7, false)).ToArray();

            Assert.AreEqual(3, target.Length);
            CollectionAssert.AreEqual(testvalues, target, new CustomEntityComparer());
        }
 public void GeoFileReader_ThrowsOnUnknownSpecifiedFileType()
 {
     //When and unknown filetype is specified an exception should be thrown
     var gf     = new GeoFileReader();
     var target = gf.ReadRecords <CustomEntity>(@"testdata\invalid.ext", (FileType)999, new CustomParser(5, 0, new[] { '\t' }, Encoding.UTF8, false)).ToArray();
 }
 public void GeoFileReader_DoesNotThrowOnInvalidExtensionButSpecifiedFileType()
 {
     //When filetype is specified and an unknown extension is used it should be read fine
     var gf     = new GeoFileReader();
     var target = gf.ReadRecords <CustomEntity>(@"testdata\invalid.ext", FileType.Plain, new CustomParser(5, 0, new[] { '\t' }, Encoding.UTF8, false)).ToArray();
 }
 public void GeoFileReader_ThrowsOnFailureWhenAutodetectingFileType()
 {
     //When filetype == autodetect and an unknown extension is used an exception should be thrown
     var gf     = new GeoFileReader();
     var target = gf.ReadRecords <CustomEntity>(@"testdata\invalid.ext", new CustomParser(5, 0, new[] { '\t' }, Encoding.UTF8, false)).ToArray();
 }
 public void GeoFileReader_ThrowsOnUnknownSpecifiedFileType()
 {
     //When and unknown filetype is specified an exception should be thrown
     var gf = new GeoFileReader();
     var target = gf.ReadRecords<CustomEntity>(@"testdata\invalid.ext", (FileType)999, new CustomParser(5, 0, new[] { '\t' }, Encoding.UTF8, false)).ToArray();
 }
 public void GeoFileReader_ThrowsOnFailureWhenAutodetectingFileType()
 {
     //When filetype == autodetect and an unknown extension is used an exception should be thrown
     var gf = new GeoFileReader();
     var target = gf.ReadRecords<CustomEntity>(@"testdata\invalid.ext", new CustomParser(5, 0, new[] { '\t' }, Encoding.UTF8, false)).ToArray();
 }
 public void GeoFileReader_ParsesFileCorrectly2()
 {
     var gf = new GeoFileReader();
     var target = gf.ReadRecords<CustomEntity>(@"testdata\test_geofilereadercustom2.txt", new CustomParser(4, 0, new[] { '!' }, Encoding.UTF8, false)).ToArray();
     Assert.AreEqual(3, target.Length);
 }
 public void GeoFileReader_DoesNotThrowOnInvalidExtensionButSpecifiedFileType()
 {
     //When filetype is specified and an unknown extension is used it should be read fine
     var gf = new GeoFileReader();
     var target = gf.ReadRecords<CustomEntity>(@"testdata\invalid.ext", FileType.Plain, new CustomParser(5, 0, new[] { '\t' }, Encoding.UTF8, false)).ToArray();
 }