public void NameTable_can_save_and_load() { StringTable stringTable = new StringTable(); StringTable.CachingBuilder stringTableBuilder = new StringTable.CachingBuilder(stringTable); NameTable nameTable = new NameTable('.', stringTable); NameTable.Builder nameTableBuilder = new NameTable.Builder(nameTable, stringTableBuilder); nameTableBuilder.GetOrAdd("a.b.c"); nameTableBuilder.GetOrAdd("a.b.d.e"); nameTableBuilder.GetOrAdd("a.f.g.h"); stringTable.SaveToFile(TemporaryDirectory, $"{nameof(StringTable)}.txt"); nameTable.SaveToFile(TemporaryDirectory, $"{nameof(NameTable)}.bin"); StringTable stringTable2 = new StringTable(); NameTable nameTable2 = new NameTable('.', stringTable2); stringTable2.LoadFromFile(TemporaryDirectory, $"{nameof(StringTable)}.txt"); nameTable2.LoadFromFile(TemporaryDirectory, $"{nameof(NameTable)}.bin"); XAssert.AreEqual(8, nameTable2.Count); XAssert.AreEqual("a", nameTable2.GetText(nameTable2.Ids.First())); XAssert.AreEqual("a.f.g.h", nameTable2.GetText(nameTable2.Ids.Last())); }