public void Must_parse_correctly(string headerValue) { TeHeader[] headers = TeHeader.ParseMany(headerValue).ToArray(); Assert.That(headers, Has.Length.EqualTo(3)); Assert.That(headers[0].TCoding, Is.EqualTo("trailers")); Assert.That(headers[0].Parameters.ElementAt(0).Name, Is.EqualTo("b")); Assert.That(headers[0].Parameters.ElementAt(0).Value, Is.EqualTo("1")); Assert.That(headers[0].Parameters.ElementAt(1).Name, Is.EqualTo("c")); Assert.That(headers[0].Parameters.ElementAt(1).Value, Is.EqualTo("1")); Assert.That(headers[0].Qvalue, Is.Null); Assert.That(headers[0].EffectiveQvalue, Is.EqualTo(1m)); Assert.That(headers[1].TCoding, Is.EqualTo("trailers")); Assert.That(headers[1].Parameters, Is.Empty); Assert.That(headers[1].Qvalue, Is.Null); Assert.That(headers[1].EffectiveQvalue, Is.EqualTo(1m)); Assert.That(headers[2].TCoding, Is.EqualTo("deflate")); Assert.That(headers[2].Parameters, Is.Empty); Assert.That(headers[2].Qvalue, Is.EqualTo(0.5m)); Assert.That(headers[2].EffectiveQvalue, Is.EqualTo(0.5m)); }
public void Must_not_result_in_header(string headerValue) { Assert.That(TeHeader.ParseMany(headerValue), Is.Empty); }
public void Must_not_match(string headerValue, string tCoding) { TeHeader header = TeHeader.ParseMany(headerValue).Single(); Assert.That(header.TCodingMatches(tCoding), Is.False); }