示例#1
0
        public void select_first_with_a_wild_card()
        {
            var currentMimeType = new CurrentMimeType("application/x-www-form-urlencoded; charset=UTF-8", "text/html, */*");
            currentMimeType
                .SelectFirstMatching(new[]{"text/json", "application/json"})
                .ShouldEqual("text/json");

            currentMimeType
                .SelectFirstMatching(new[] { "application/json", "text/json" })
                .ShouldEqual("application/json");
        }
 public void select_first_when_one_does_match()
 {
     var currentMimeType = new CurrentMimeType("application/x-www-form-urlencoded; charset=UTF-8", "text/html, application/json, */*");
     currentMimeType
         .SelectFirstMatching(new[] { "text/json", "application/json" })
         .ShouldBe("application/json");
 }