public void WriteString_Sync() { using (var f = new GenericFile()) { var original = new byte[] { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x50, 0x6F, 0x6B, 0xC3, 0xA9, 0x6D, 0x6F, 0x01 }; f.CreateFile(original); f.WriteString(0, Encoding.UTF8, "Pokémon"); f.WriteString(9, Encoding.UTF8, "1234567"); Assert.IsTrue(new byte[] { 0x50, 0x6F, 0x6B, 0xC3, 0xA9, 0x6D, 0x6F, 0x6E, 0x01, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x01 }.SequenceEqual(f.Read())); } }