Exemple #1
0
        public void Accept_Language()
        {
            StringWithQualityHeaderValue[] expected = new StringWithQualityHeaderValue[] {
                new StringWithQualityHeaderValue("de-CH"),
                new StringWithQualityHeaderValue("de"),
                new StringWithQualityHeaderValue("en", 0.5),
                new StringWithQualityHeaderValue("fr", 0.2)
            };

            Assert.AreEqual(expected.OrderBy(o => o.Quality), "de-CH, de, en;q=0.5, fr;q=0.2".ToAcceptLanguage().OrderBy(o => o.Quality));
        }