public void SetValueCorrectly() { var headers = new RestHeaders(); headers.Set("foo", "bar"); Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found"); Assert.Equal("bar", values.Single()); }
public void SetValuesCorrectly() { var headers = new RestHeaders(); headers.Set("foo", "bar", "bla"); Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found"); Assert.True(values.Any(x => x == "bar"), "bar value not found"); Assert.True(values.Any(x => x == "bla"), "bla value not found"); }
public void SetValuesDoesOverwriteExistingValues() { var headers = new RestHeaders { { "foo", "bar" } }; headers.Set("foo", "bla"); Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found"); Assert.Equal("bla", values.Single()); }
public void SetValueDoesOverwriteExistingValues() { var headers = new RestHeaders { { "foo", "bar" } }; headers.Set("foo", "bla", "baz"); Assert.True(headers.TryGetValue("foo", out ISet <string> values), "foo key not found"); Assert.True(values.Any(x => x == "bla"), "bla value not found"); Assert.True(values.Any(x => x == "baz"), "baz value not found"); }