public void appends_the_header()
		{
			var id = "123";
			var writer = MockRepository.GenerateMock<IOutputWriter>();
			var headers = new StubRequestHeaders();

			headers.Values.Add(CorrelateRequests.Correlation_Id, id);


			new CorrelateRequests(headers, writer).Correlate();

			writer.AssertWasCalled(w => w.AppendHeader(CorrelateRequests.Correlation_Id, id));
		}
        public void bind_by_header()
        {
            var headers = new StubRequestHeaders();
            headers.Data["Last-Event-ID"] = "something";
            headers.Data[HttpResponseHeaders.Warning] = "oh no!";

            var target = BindingScenario<HeaderValueTarget>.For(x =>
            {
                x.Service<IRequestHeaders>(headers);

            }).Model;

            target.LastEventId.ShouldEqual("something");
            target.Warning.ShouldEqual("oh no!");
        }
Example #3
0
        public void bind_by_header()
        {
            var headers = new StubRequestHeaders();

            headers.Data["Last-Event-ID"]             = "something";
            headers.Data[HttpResponseHeaders.Warning] = "oh no!";

            var target = BindingScenario <HeaderValueTarget> .For(x =>
            {
                x.Service <IRequestHeaders>(headers);
            }).Model;

            target.LastEventId.ShouldEqual("something");
            target.Warning.ShouldEqual("oh no!");
        }