コード例 #1
0
        public void No_body()
        {
            var req = CreateReq(false, null, BodyOptions.None);

            foreach (var cbs in Permute(req))
            {
                context = new TxContext(cbs);
                loop = new TxLoop(context, req);
                loop.Drive(cbs, false);

                Assert.That(context.HasRequestBody(), Is.False);
                context.AssertMessageObserver();
                context.AssertRequestBody(req);
                context.AssertResponseDelegate(false);
            }
        }
コード例 #2
0
        public void Some_body(
            [Values(true, false)]
            bool expectContinue,
            [Values(
            BodyOptions.ContentLength,
            BodyOptions.TransferEncodingChunked)]
            BodyOptions options)
        {
            var req = CreateReq(expectContinue, new[] { "some", "body" }, options);

            foreach (var cbs in Permute(req))
            {
                context = new TxContext(cbs);
                loop = new TxLoop(context, req);
                loop.Drive(cbs, false);

                Assert.That(context.HasRequestBody(), Is.True);
                context.AssertMessageObserver();
                context.AssertRequestBody(req);
                context.AssertResponseDelegate(expectContinue);
            }
        }
コード例 #3
0
 public TxLoop(TxContext context, Req req)
 {
     this.context = context;
     this.req = req;
 }