public void ThrowsWhenAddingHeaderAfterReadOnlyIsSet()
        {
            var headers = new FrameResponseHeaders();

            headers.SetReadOnly();

            Assert.Throws <InvalidOperationException>(() => ((IDictionary <string, StringValues>)headers).Add("my-header", new[] { "value" }));
        }
        public void ThrowsWhenChangingHeaderAfterReadOnlyIsSet()
        {
            var headers    = new FrameResponseHeaders();
            var dictionary = (IDictionary <string, StringValues>)headers;

            dictionary.Add("my-header", new[] { "value" });
            headers.SetReadOnly();

            Assert.Throws <InvalidOperationException>(() => dictionary["my-header"] = "other-value");
        }