75 references to StringWithQualityHeaderValue
Microsoft.Net.Http.Headers.Tests (75)
StringWithQualityHeaderValueTest.cs (75)
23var value = new StringWithQualityHeaderValue("token", 0.5); 27Assert.Throws<ArgumentException>(() => new StringWithQualityHeaderValue(null, 0.1)); 28Assert.Throws<ArgumentException>(() => new StringWithQualityHeaderValue("", 0.1)); 29Assert.Throws<FormatException>(() => new StringWithQualityHeaderValue("in valid", 0.1)); 31Assert.Throws<ArgumentOutOfRangeException>(() => new StringWithQualityHeaderValue("t", 1.1)); 32Assert.Throws<ArgumentOutOfRangeException>(() => new StringWithQualityHeaderValue("t", -0.1)); 41value = new StringWithQualityHeaderValue("token", 0.1); 44value = new StringWithQualityHeaderValue("token", 0); 47value = new StringWithQualityHeaderValue("token", 1); 51value = new StringWithQualityHeaderValue("token", 0.56789); 58var value1 = new StringWithQualityHeaderValue("t", 0.123); 59var value2 = new StringWithQualityHeaderValue("t", 0.123); 60var value3 = new StringWithQualityHeaderValue("T", 0.123); 62var value5 = new StringWithQualityHeaderValue("x", 0.123); 63var value6 = new StringWithQualityHeaderValue("t", 0.5); 64var value7 = new StringWithQualityHeaderValue("t", 0.1234); 81var value1 = new StringWithQualityHeaderValue("t", 0.123); 82var value2 = new StringWithQualityHeaderValue("t", 0.123); 83var value3 = new StringWithQualityHeaderValue("T", 0.123); 85var value5 = new StringWithQualityHeaderValue("x", 0.123); 86var value6 = new StringWithQualityHeaderValue("t", 0.5); 87var value7 = new StringWithQualityHeaderValue("t", 0.1234); 107CheckValidParse("text;q=0.5", new StringWithQualityHeaderValue("text", 0.5)); 108CheckValidParse("text ; q = 0.5", new StringWithQualityHeaderValue("text", 0.5)); 109CheckValidParse("\r\n text ; q = 0.5 ", new StringWithQualityHeaderValue("text", 0.5)); 111CheckValidParse(" \r\n text \r\n ; \r\n q = 0.123", new StringWithQualityHeaderValue("text", 0.123)); 112CheckValidParse(" text ; q = 0.123 ", new StringWithQualityHeaderValue("text", 0.123)); 113CheckValidParse("text;q=1 ", new StringWithQualityHeaderValue("text", 1)); 115CheckValidParse("*;q=0.7", new StringWithQualityHeaderValue("*", 0.7)); 117CheckValidParse("t;q=0.", new StringWithQualityHeaderValue("t", 0)); 118CheckValidParse("t;q=1.", new StringWithQualityHeaderValue("t", 1)); 119CheckValidParse("t;q=1.000", new StringWithQualityHeaderValue("t", 1)); 120CheckValidParse("t;q=0.12345678", new StringWithQualityHeaderValue("t", 0.12345678)); 121CheckValidParse("t ; q = 0", new StringWithQualityHeaderValue("t", 0)); 123CheckValidParse("unicode-1-1; q=0.8", new StringWithQualityHeaderValue("unicode-1-1", 0.8)); 168CheckValidTryParse("text;q=0.5", new StringWithQualityHeaderValue("text", 0.5)); 169CheckValidTryParse("text ; q = 0.5", new StringWithQualityHeaderValue("text", 0.5)); 170CheckValidTryParse("\r\n text ; q = 0.5 ", new StringWithQualityHeaderValue("text", 0.5)); 172CheckValidTryParse(" \r\n text \r\n ; \r\n q = 0.123", new StringWithQualityHeaderValue("text", 0.123)); 225new StringWithQualityHeaderValue("text3", 0.5), 226new StringWithQualityHeaderValue("text4", 0.5), 227new StringWithQualityHeaderValue("text5", 0.5), 228new StringWithQualityHeaderValue("text6", 0.05), 230new StringWithQualityHeaderValue("text8", 0.5), 232new StringWithQualityHeaderValue("text10", 0.5), 262new StringWithQualityHeaderValue("text3", 0.5), 263new StringWithQualityHeaderValue("text4", 0.5), 264new StringWithQualityHeaderValue("text5", 0.5), 265new StringWithQualityHeaderValue("text6", 0.05), 267new StringWithQualityHeaderValue("text8", 0.5), 269new StringWithQualityHeaderValue("text10", 0.5), 299new StringWithQualityHeaderValue("text3", 0.5), 300new StringWithQualityHeaderValue("text4", 0.5), 301new StringWithQualityHeaderValue("text5", 0.5), 302new StringWithQualityHeaderValue("text6", 0.05), 304new StringWithQualityHeaderValue("text8", 0.5), 306new StringWithQualityHeaderValue("text10", 0.5), 336new StringWithQualityHeaderValue("text3", 0.5), 337new StringWithQualityHeaderValue("text4", 0.5), 338new StringWithQualityHeaderValue("text5", 0.5), 339new StringWithQualityHeaderValue("text6", 0.05), 341new StringWithQualityHeaderValue("text8", 0.5), 343new StringWithQualityHeaderValue("text10", 0.5), 373new StringWithQualityHeaderValue("text3", 0.5), 374new StringWithQualityHeaderValue("text4", 0.5), 376new StringWithQualityHeaderValue("text5", 0.5), 377new StringWithQualityHeaderValue("text6", 0.05), 379new StringWithQualityHeaderValue("text8", 0.5), 381new StringWithQualityHeaderValue("text10", 0.5), 431new StringWithQualityHeaderValue("text3", 0.5), 432new StringWithQualityHeaderValue("text4", 0.5), 434new StringWithQualityHeaderValue("text5", 0.5), 435new StringWithQualityHeaderValue("text6", 0.05), 437new StringWithQualityHeaderValue("text8", 0.5), 439new StringWithQualityHeaderValue("text10", 0.5),