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); } }
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); } }
public TxLoop(TxContext context, Req req) { this.context = context; this.req = req; }