Exemple #1
0
        public void ToStringTest(string result, params string[] values)
        {
            var instance = TestCommon.ValuesToHeaders(values);

            Assert.Equal(instance.ToString(), result);
            Assert.Equal($"{instance}", result);
        }
Exemple #2
0
        public void References(int count, params string[] values)
        {
            var instance   = TestCommon.ValuesToHeaders(values);
            var references = instance.References();

            Assert.Equal(count, references.Length);
            Assert.Equal(values.Last(), references[references.Length - 1]);
        }
Exemple #3
0
        public void Invalid(string errorKey, params string[] values)
        {
            var instance = TestCommon.ValuesToHeaders(values);

            Assert.False(instance.Valid);
            Assert.Equal(instance.InvalidPair !.Value.Key, errorKey);
            Assert.Throws <InvalidOperationException>(() => instance.Validate());
        }
Exemple #4
0
        public void ToStringTest(string result, string method, string protocol, string version, params string[] headers)
        {
            var instance = new Request {
                Method = method, Protocol = protocol, Version = version, Headers = TestCommon.ValuesToHeaders(headers)
            };

            Assert.Equal(instance.ToString(), result);
            Assert.Equal($"{instance}", result);
        }
Exemple #5
0
        public void ToStringTest(string result, int statusCode, string protocol, string version, params string[] headers)
        {
            var instance = new Response {
                StatusCode = statusCode, Protocol = protocol, Version = version, Headers = TestCommon.ValuesToHeaders(headers)
            };

            Assert.Equal(instance.ToString(), result);
            Assert.Equal($"{instance}", result);
        }