Exemplo n.º 1
0
        public void InvalidText(string fileName)
        {
            var text = System.IO.File.ReadAllText($"..\\..\\..\\test files\\{fileName}", System.Text.Encoding.UTF8);

            try
            {
                TlkParser.TextToTlk(text);
                Assert.True(false);
            }
            catch (ArgumentException)
            {
                Assert.True(true);
            }
        }
Exemplo n.º 2
0
        public void TextToTlk(string fileName)
        {
            var text = System.IO.File.ReadAllText($"..\\..\\..\\test files\\{fileName}", System.Text.Encoding.UTF8);
            var tlk  = TlkParser.TextToTlk(text);

            Assert.Equal(3, tlk.StringCount);
            Assert.Equal("dummy", tlk.StringEntryTable[0]);
            Assert.Equal("yummy", tlk.StringEntryTable[1]);
            Assert.Equal("entry", tlk.StringEntryTable[2]);
            Assert.Equal(140, tlk.StringEntriesOffset);
            Assert.Equal(0, tlk.StringDataTable[0].OffsetToString);
            Assert.Equal(5, tlk.StringDataTable[0].StringSize);
            Assert.Equal(5, tlk.StringDataTable[1].OffsetToString);
            Assert.Equal(5, tlk.StringDataTable[1].StringSize);
            Assert.Equal(10, tlk.StringDataTable[2].OffsetToString);
            Assert.Equal(5, tlk.StringDataTable[2].StringSize);
        }