예제 #1
0
        public void TestToText(string sbnFile)
        {
            if (!File.Exists(sbnFile))
            {
                throw new IgnoreException("File '" + sbnFile + "' not found!");
            }

            SbnTree sbn = null;

            Assert.DoesNotThrow(() => sbn = SbnTree.Load(sbnFile));
            Assert.DoesNotThrow(() => SbnTree.SbnToText(sbnFile, new StreamWriter(File.OpenWrite(Path.ChangeExtension(sbnFile, ".sbn.txt")))));
            Assert.IsNotNull(sbn);
            Assert.IsTrue(sbn.VerifyNodes());

            var sbnTestFile = Path.ChangeExtension(sbnFile, null) + "_test.sbn";

            Assert.DoesNotThrow(() => sbn.Save(sbnTestFile));
            Assert.DoesNotThrow(() => SbnTree.SbnToText(sbnTestFile, new StreamWriter(File.OpenWrite(Path.ChangeExtension(sbnTestFile, ".sbn.txt")))));
        }
예제 #2
0
        public void Test(string sbnFile)
        {
            if (!File.Exists(sbnFile))
            {
                throw new IgnoreException("File '" + sbnFile + "' not found!");
            }

            SbnTree sbn = null;

            Assert.DoesNotThrow(() => sbn = SbnTree.Load(sbnFile));
            Assert.IsNotNull(sbn);
            Assert.IsTrue(sbn.VerifyNodes());

            var sbnTestFile = Path.ChangeExtension(sbnFile, null) + "_test.sbn";

            Assert.DoesNotThrow(() => sbn.Save(sbnTestFile));

            var fiO = new FileInfo(sbnFile);
            var fiT = new FileInfo(sbnTestFile);

            Assert.AreEqual(fiO.Length, fiT.Length);
        }
예제 #3
0
 void ISpatialIndex <uint> .SaveIndex(string filename)
 {
     _sbnTree.Save(Path.ChangeExtension(filename, "sbn"));
     //throw new NotImplementedException();
 }