コード例 #1
0
        public void Generate_Test2()
        {
            var entries = new VdfsEntryListBuilder()
                          /*0*/.AddDirectory("1", 2)
                          /*1*/.AddLastDirectory("2", 6)
                          /*2*/.AddDirectory("_WORK1_1", 4)
                          /*3*/.AddLastDirectory("_WORK1_2", 5)
                          /*4*/.AddLast("TEST1_1.TXT")
                          /*5*/.AddLast("TEST1_2.TXT")
                          /*6*/.AddDirectory("_WORK2_1", 8)
                          /*7*/.AddLastDirectory("_WORK2_2", 9)
                          /*8*/.AddLast("TEST2_1.TXT")
                          /*9*/.AddLast("TEST2_2.TXT").Entries.ToArray();

            var expected = new StringBuilder();

            expected.AppendLine("+- 1");
            expected.AppendLine("|  +- _WORK1_1");
            expected.AppendLine("|  |  +- TEST1_1.TXT");
            expected.AppendLine("|  +- _WORK1_2");
            expected.AppendLine("|     +- TEST1_2.TXT");
            expected.AppendLine("+- 2");
            expected.AppendLine("   +- _WORK2_1");
            expected.AppendLine("   |  +- TEST2_1.TXT");
            expected.AppendLine("   +- _WORK2_2");
            expected.AppendLine("      +- TEST2_2.TXT");

            Assert.AreEqual(generateVdfsEntriesTreeView(entries), expected.ToString());
            Assert.AreEqual(generateVdfsEntriesTreeView("Samples/test2.vdf"), expected.ToString());
        }
コード例 #2
0
        public void Generate_Test4()
        {
            var entries = new VdfsEntryListBuilder()
                          /*0*/.Add("HEIßE.TXT")
                          /*1*/.AddLast("Ó.TXT").Entries.ToArray();

            var expected = new StringBuilder();

            expected.AppendLine("+- HEIßE.TXT");
            expected.AppendLine("+- Ó.TXT");

            Assert.AreEqual(generateVdfsEntriesTreeView(entries), expected.ToString());
            Assert.AreEqual(generateVdfsEntriesTreeView("Samples/test4.vdf"), expected.ToString());
        }
コード例 #3
0
        public void Generate_Test3()
        {
            var entries = new VdfsEntryListBuilder()
                          /*0*/.AddDirectory("DIR", 2)
                          /*1*/.AddLast("FILE1.TXT")
                          /*2*/.AddLast("FILE2.TXT").Entries.ToArray();

            var expected = new StringBuilder();

            expected.AppendLine("+- DIR");
            expected.AppendLine("|  +- FILE2.TXT");
            expected.AppendLine("+- FILE1.TXT");

            Assert.AreEqual(generateVdfsEntriesTreeView(entries), expected.ToString());
            Assert.AreEqual(generateVdfsEntriesTreeView("Samples/test3.vdf"), expected.ToString());
        }
コード例 #4
0
        public void Generate_Test1()
        {
            var entries = new VdfsEntryListBuilder()
                          /*0*/.AddLastDirectory("_WORK", 1)
                          /*1*/.AddLastDirectory("DATA", 2)
                          /*2*/.AddDirectory("SCRIPTS", 4)
                          /*3*/.AddLastDirectory("TEXTURES", 5)
                          /*4*/.AddLast("SCRIPT.D")
                          /*5*/.AddLast("TEXTURE.TEX").Entries.ToArray();

            var expected = new StringBuilder();

            expected.AppendLine("+- _WORK");
            expected.AppendLine("   +- DATA");
            expected.AppendLine("      +- SCRIPTS");
            expected.AppendLine("      |  +- SCRIPT.D");
            expected.AppendLine("      +- TEXTURES");
            expected.AppendLine("         +- TEXTURE.TEX");

            Assert.AreEqual(generateVdfsEntriesTreeView(entries), expected.ToString());
            Assert.AreEqual(generateVdfsEntriesTreeView("Samples/test.vdf"), expected.ToString());
        }