public InMemoryCommunicationContext()
 {
     ApplicationBaseUri = new Uri("http://local");
     Request = new InMemoryRequest();
     Response = new InMemoryResponse();
     ServerErrors = new List<Error>();
     PipelineData = new PipelineData();
 }
 public InMemoryCommunicationContext()
 {
     ApplicationBaseUri = new Uri("http://localhost/");
     Request            = new InMemoryRequest();
     Response           = new InMemoryResponse();
     ServerErrors       = new List <Error>();
     PipelineData       = new PipelineData();
 }
        public void the_content_is_written_to_the_stream()
        {
            var codec = new JsonDataContractCodec();
            var stub = new InMemoryResponse();
            codec.WriteTo(new Customer { Name = "hello" }, stub.Entity, null);

            stub.Entity.Stream.Position.ShouldNotBe(0);
        }
Ejemplo n.º 4
0
 public InMemoryCommunicationContext()
 {
     ApplicationBaseUri = new Uri("http://local");
     Request            = new InMemoryRequest();
     Response           = new InMemoryResponse();
     ServerErrors       = new List <Error>();
     Environment        = new Environment();
 }
 public InMemoryCommunicationContext()
 {
     ApplicationBaseUri = new Uri("http://local");
     Request = new InMemoryRequest();
     Response = new InMemoryResponse();
     ServerErrors = new List<Error>();
     Environment = new Environment();
 }
        public void Given_ABasicAuthenticatorWithARealm_When_ChallengingAResponse_Then_TheResponseHasAWWWAuthenticateHeader()
        {
            // given
            string realm = "Lex Luthors Palace";
            var response = new InMemoryResponse();

            _mockAuthenticator
                .ExpectGet(auth => auth.Realm)
                .Returns(realm);

            // when
            _basicScheme.Challenge(response);

            // then
            var expectedChallengeHeader = string.Format("Basic realm=\"{0}\"", realm);
            response.Headers.ShouldContain("WWW-Authenticate", expectedChallengeHeader);
        }
 public void when_I_write(object obj)
 {
     var response = new InMemoryResponse();
     Codec.WriteTo(obj, response.Entity, new string[0]);
     ReadResponse(response);
 }
 public void GivenACodec(string handlerName)
 {
     codec = new JsonPCodec<JsonDataContractCodec>(handlerName, new JsonDataContractCodec());
     stub = new InMemoryResponse();
 }