Пример #1
0
        public void TryParse_Fail(string text, string expected)
        {
            Assert.That(LanguageTag.TryParse(text).HasValue, Is.False);

            LanguageTag tag;
            var         result = LanguageTag.TryParse(text, out tag);

            Assert.That(result, Is.False);
            Assert.That(tag, Is.EqualTo(LanguageTag.Parse(expected)));
        }
Пример #2
0
        public void TryParse_Success()
        {
            LanguageTag?tag1 = LanguageTag.TryParse("en-GB");

            LanguageTag tag2;
            var         result = LanguageTag.TryParse("en-GB", out tag2);

            Assert.That(result, Is.True);
            Assert.That(tag1, Is.EqualTo(tag2));
        }