Ejemplo n.º 1
0
        public void Test_GetAllKeys()
        {
            StringValues.ForEach(x => SetEntry(x, TestValue));

            var response = base.Send <GetAllKeysResponse>(
                new GetAllKeys(), x => x.ResponseStatus);

            Assert.That(response.Keys, Is.EquivalentTo(StringValues));
        }
Ejemplo n.º 2
0
        public void Test_GetValues()
        {
            StringValues.ForEach(x => SetEntry(x, x));

            var response = base.Send <GetValuesResponse>(
                new GetValues {
                Keys = StringValues
            }, x => x.ResponseStatus);

            Assert.That(response.Values, Is.EqualTo(StringValues));
        }
Ejemplo n.º 3
0
        public override Expression Build(BuildArgument arg)
        {
            ParseValues();
            var arr = Array.CreateInstance(Type, StringValues.Count);
            var i   = 0;

            StringValues.ForEach((p) =>
            {
                var value = p.Cast(Type);
                arr.SetValue(value, i++);
            });

            return(Expression.Constant(arr));
        }
        /// <inheritdoc />
        public IAndHttpResponseTestBuilder ContainingHeader(string name, StringValues values)
        {
            this.ContainingHeader(name);
            var headerValues = this.httpResponse.Headers[name];

            if (values.Count != headerValues.Count)
            {
                this.ThrowNewHttpResponseAssertionException(
                    "headers",
                    $"to contain header with '{name}' name and {values.Count} {(values.Count != 1 ? "values" : "value")}",
                    $"instead found {headerValues.Count}");
            }

            values.ForEach(v => this.ValidateHeaderValues(name, v, headerValues));
            return(this);
        }