Exemplo n.º 1
0
        public void WrittenIn()
        {
            var greetings = new Text[]
            {
                new Text(english, "hello world"),
                new Text(oz, "g'day mate")
            };

            Assert.AreEqual("hello world", greetings.WrittenIn(english));
            Assert.AreEqual("g'day mate", greetings.WrittenIn(oz));
            Assert.AreEqual("g'day mate", greetings.WrittenIn("en-AU-SYDNEY"));
            Assert.AreEqual("hello world", greetings.WrittenIn(kiwi));
            Assert.AreEqual("hello world", greetings.WrittenIn("fr"));
            Assert.AreEqual("hello world", greetings.WrittenIn("fr-CN"));

            Assert.AreEqual("", new Text[0].WrittenIn(english));
        }
Exemplo n.º 2
0
        public void LanguageTagCaseInsensitive()
        {
            var greetings = new Text[]
            {
                new Text(english, "hello world"),
                new Text(oz, "g'day mate")
            };

            Assert.AreEqual("hello world", greetings.WrittenIn(english));
            Assert.AreEqual("g'day mate", greetings.WrittenIn(oz));
            Assert.AreEqual("g'day mate", greetings.WrittenIn("EN-au-SYDNEY"));
            Assert.AreEqual("hello world", greetings.WrittenIn(kiwi));
            Assert.AreEqual("hello world", greetings.WrittenIn("FR"));
            Assert.AreEqual("hello world", greetings.WrittenIn("FR-cn"));

            Assert.IsTrue(greetings.HasExactValue(english));
            Assert.IsTrue(greetings.HasExactValue(english));
            Assert.IsTrue(greetings.HasExactValue(english));
            Assert.IsTrue(greetings.HasExactValue(oz));
            Assert.IsTrue(greetings.HasExactValue(oz));
            Assert.IsTrue(greetings.HasExactValue(oz));
            Assert.IsTrue(greetings.HasExactValue(oz));
            Assert.IsTrue(greetings.HasExactValue(oz));
        }