示例#1
0
        public void ExpectSwitchingToInvalidLanguageToFail()
        {
            ExpectLocaliserToInitialise();

            Assert.IsFalse(Localiser.SwitchCulture("noSuchLocale"));

            Assert.AreEqual("en-GB", Localiser.CurrentLocale.Name);
        }
示例#2
0
        public void ExpectSwitchingToValidLanguageToWork()
        {
            ExpectLocaliserToInitialise();

            Assert.IsTrue(Localiser.SwitchCulture("fr"));

            Assert.AreEqual("Bonjour", TestLoc.Get(TestKeys.Test.Hello));
            Assert.AreEqual("Merci", TestLoc.Get(TestKeys.Test.ThankYou));
            Assert.AreEqual("Au revoir", TestLoc.Get(TestKeys.Test.Goodbye));
        }