コード例 #1
0
 public InMemoryCommunicationContext()
 {
     ApplicationBaseUri = new Uri("http://local");
     Request = new InMemoryRequest();
     Response = new InMemoryResponse();
     ServerErrors = new List<Error>();
     PipelineData = new PipelineData();
 }
コード例 #2
0
 public InMemoryCommunicationContext()
 {
     ApplicationBaseUri = new Uri("http://localhost/");
     Request            = new InMemoryRequest();
     Response           = new InMemoryResponse();
     ServerErrors       = new List <Error>();
     PipelineData       = new PipelineData();
 }
コード例 #3
0
        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);
        }
コード例 #4
0
 public InMemoryCommunicationContext()
 {
     ApplicationBaseUri = new Uri("http://local");
     Request            = new InMemoryRequest();
     Response           = new InMemoryResponse();
     ServerErrors       = new List <Error>();
     Environment        = new Environment();
 }
コード例 #5
0
 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);
        }
コード例 #7
0
 public void when_I_write(object obj)
 {
     var response = new InMemoryResponse();
     Codec.WriteTo(obj, response.Entity, new string[0]);
     ReadResponse(response);
 }
コード例 #8
0
 public void GivenACodec(string handlerName)
 {
     codec = new JsonPCodec<JsonDataContractCodec>(handlerName, new JsonDataContractCodec());
     stub = new InMemoryResponse();
 }