public void ChangeSymbolText() { File.Delete(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); File.Copy(TestUtil.GetTestFile("desclocalize\\symbols.xml"), TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); SymbolDB symbolDB = new SymbolDB(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); DescriptionLocalize localizer = new DescriptionLocalize(symbolDB); Dictionary <string, List <SymbolText> > dictionary = new Dictionary <string, List <SymbolText> >(); dictionary["1.3"] = new List <SymbolText>() { new SymbolText() { Lang = "en", Plural = false, Gender = "", Text = "sloping valley thing" }, }; localizer.CustomizeDescriptionTexts(dictionary); SymbolText[] expectedReentrants = { new SymbolText() { Lang = "en", Plural = false, Gender = "", Text = "sloping valley thing" } }; CollectionAssert.AreEquivalent(expectedReentrants, symbolDB["1.3"].SymbolTexts); }
public void ChangeSymbolText() { File.Delete(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); File.Copy(TestUtil.GetTestFile("desclocalize\\symbols.xml"), TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); SymbolDB symbolDB = new SymbolDB(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); DescriptionLocalize localizer = new DescriptionLocalize(symbolDB); Dictionary<string, List<SymbolText>> dictionary = new Dictionary<string, List<SymbolText>>(); dictionary["1.3"] = new List<SymbolText>() { new SymbolText() {Lang = "en", Plural = false, Gender = "", Text = "sloping valley thing"}, }; localizer.CustomizeDescriptionTexts(dictionary); SymbolText[] expectedReentrants = { new SymbolText() {Lang = "en", Plural = false, Gender = "", Text = "sloping valley thing"} }; CollectionAssert.AreEquivalent(expectedReentrants, symbolDB["1.3"].SymbolTexts); }
public void AddSymbolText() { File.Delete(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); File.Copy(TestUtil.GetTestFile("desclocalize\\symbols.xml"), TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); SymbolDB symbolDB = new SymbolDB(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); DescriptionLocalize localizer = new DescriptionLocalize(symbolDB); Dictionary <string, List <SymbolText> > dictionary = new Dictionary <string, List <SymbolText> >(); dictionary["1.1"] = new List <SymbolText>() { new SymbolText() { Lang = "de", Plural = false, Gender = "masculine", Text = "german-terrace", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "de", Plural = true, Gender = "masculine", Text = "german-terraces", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "fr", Plural = false, Gender = "feminine", Text = "french-terrace", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "fr", Plural = true, Gender = "feminine", Text = "french-terraces", Case = "", CaseOfModified = "" }, }; dictionary["5.20"] = new List <SymbolText>() { new SymbolText() { Lang = "de", Plural = false, Gender = "neuter", Text = "german-statue", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "de", Plural = true, Gender = "neuter", Text = "german-statues", Case = "", CaseOfModified = "" }, }; localizer.CustomizeDescriptionTexts(dictionary); SymbolText[] expectedTerraces = { new SymbolText() { Lang = "en", Plural = false, Gender = "", Text = "terrace", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "en", Plural = true, Gender = "", Text = "terraces", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "de", Plural = false, Gender = "masculine", Text = "german-terrace", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "de", Plural = true, Gender = "masculine", Text = "german-terraces", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "fr", Plural = false, Gender = "feminine", Text = "french-terrace", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "fr", Plural = true, Gender = "feminine", Text = "french-terraces", Case = "", CaseOfModified = "" } }; SymbolText[] expectedStatues = { new SymbolText() { Lang = "en", Plural = false, Gender = "", Text = "statue", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "en", Plural = true, Gender = "", Text = "statues", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "de", Plural = false, Gender = "neuter", Text = "german-statue", Case = "", CaseOfModified = "" }, new SymbolText() { Lang = "de", Plural = true, Gender = "neuter", Text = "german-statues", Case = "", CaseOfModified = "" }, }; CollectionAssert.AreEquivalent(expectedTerraces, symbolDB["1.1"].SymbolTexts); CollectionAssert.AreEquivalent(expectedStatues, symbolDB["5.20"].SymbolTexts); }
public void AddSymbolText() { File.Delete(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); File.Copy(TestUtil.GetTestFile("desclocalize\\symbols.xml"), TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); SymbolDB symbolDB = new SymbolDB(TestUtil.GetTestFile("desclocalize\\symbols_working.xml")); DescriptionLocalize localizer = new DescriptionLocalize(symbolDB); Dictionary<string, List<SymbolText>> dictionary = new Dictionary<string, List<SymbolText>>(); dictionary["1.1"] = new List<SymbolText>() { new SymbolText() {Lang = "de", Plural = false, Gender = "masculine", Text = "german-terrace", Case="", CaseOfModified=""}, new SymbolText() {Lang = "de", Plural = true, Gender = "masculine", Text = "german-terraces", Case="", CaseOfModified=""}, new SymbolText() {Lang = "fr", Plural = false, Gender = "feminine", Text = "french-terrace", Case="", CaseOfModified=""}, new SymbolText() {Lang = "fr", Plural = true, Gender = "feminine", Text = "french-terraces", Case="", CaseOfModified=""}, }; dictionary["5.20"] = new List<SymbolText>() { new SymbolText() {Lang = "de", Plural = false, Gender = "neuter", Text = "german-statue", Case="", CaseOfModified=""}, new SymbolText() {Lang = "de", Plural = true, Gender = "neuter", Text = "german-statues", Case="", CaseOfModified=""}, }; localizer.CustomizeDescriptionTexts(dictionary); SymbolText[] expectedTerraces = { new SymbolText() {Lang = "en", Plural = false, Gender = "", Text = "terrace", Case="", CaseOfModified=""}, new SymbolText() {Lang = "en", Plural = true, Gender = "", Text = "terraces", Case="", CaseOfModified=""}, new SymbolText() {Lang = "de", Plural = false, Gender = "masculine", Text = "german-terrace", Case="", CaseOfModified=""}, new SymbolText() {Lang = "de", Plural = true, Gender = "masculine", Text = "german-terraces", Case="", CaseOfModified=""}, new SymbolText() {Lang = "fr", Plural = false, Gender = "feminine", Text = "french-terrace", Case="", CaseOfModified=""}, new SymbolText() {Lang = "fr", Plural = true, Gender = "feminine", Text = "french-terraces", Case="", CaseOfModified=""} }; SymbolText[] expectedStatues = { new SymbolText() {Lang = "en", Plural = false, Gender = "", Text = "statue", Case="", CaseOfModified=""}, new SymbolText() {Lang = "en", Plural = true, Gender = "", Text = "statues", Case="", CaseOfModified=""}, new SymbolText() {Lang = "de", Plural = false, Gender = "neuter", Text = "german-statue", Case="", CaseOfModified=""}, new SymbolText() {Lang = "de", Plural = true, Gender = "neuter", Text = "german-statues", Case="", CaseOfModified=""}, }; CollectionAssert.AreEquivalent(expectedTerraces, symbolDB["1.1"].SymbolTexts); CollectionAssert.AreEquivalent(expectedStatues, symbolDB["5.20"].SymbolTexts); }