static void Main(string[] args) { Console.OutputEncoding = Encoding.UTF8; SetNewRules(); string name = "яна Кравінський Василь Олександрович"; Transliter tr = new Transliter(); Console.WriteLine(name); Console.WriteLine(); Console.WriteLine("Translit with dafault rules:"); Console.WriteLine(tr.Translit(name)); Console.WriteLine(); Console.WriteLine("Translit with custom rules:"); tr.SetNewRules(rules); Console.WriteLine(tr.Translit(name)); Console.WriteLine(); Console.WriteLine("Translit with custom rules and modefided rule \"a\" - \"+_+\" :"); tr.ModifyRule("а", "+_+"); Console.WriteLine(tr.Translit(name)); Console.ReadKey(); }
public void ModifyRuleSimple() { string ukr = "а"; string lat = "b"; Transliter t = new Transliter(); t.ModifyRule("а", "b"); string actual = t.Translit(ukr); Assert.AreEqual(lat, t.Translit(ukr)); }