コード例 #1
0
 public void String_Ok_KeepResponse(object responseValue)
 {
     using (var request = new MemorySetup <string>(
                responseValue,
                settings => settings.ExposeRawResponse(true),
                (settings, stream) => FakeResponse.Ok(settings, response: stream)
                ))
         this.ShouldStreamOfCopy(request);
 }
コード例 #2
0
		public void Typed_Bad_KeepResponse(object responseValue)
		{
			using (var request = new MemorySetup<StandardResponse>(
				responseValue,
				settings => settings.ExposeRawResponse(true),
				(settings, stream) => FakeResponse.Bad(settings, response: stream)
			))
				this.ShouldStreamOfCopy(request, false);	
		}
コード例 #3
0
 public void Stream_Ok_DiscardResponse(object responseValue)
 {
     using (var request = new MemorySetup <Stream>(
                responseValue,
                settings => settings.ExposeRawResponse(false),
                (settings, stream) => FakeResponse.Ok(settings, response: stream)
                ))
         this.ShouldDirectlyStream(request);
 }
コード例 #4
0
 public void String_Bad_DiscardResponse(object responseValue)
 {
     using (var request = new MemorySetup <string>(
                responseValue,
                settings => settings.ExposeRawResponse(false),
                (settings, stream) => FakeResponse.Bad(settings, response: stream)
                ))
         this.ShouldStreamOfCopy(request, success: false, keepRaw: false);
 }
コード例 #5
0
 public void Stream_Bad_KeepResponse(object responseValue)
 {
     using (var request = new MemorySetup <Stream>(
                responseValue,
                settings => settings.ExposeRawResponse(true),
                (settings, stream) => FakeResponse.Bad(settings, response: stream)
                ))
         this.ShouldDirectlyStream(request, success: false);
 }
コード例 #6
0
 public void Typed_Bad_KeepResponse(object responseValue)
 {
     using (var request = new MemorySetup <StandardResponse>(
                responseValue,
                settings => settings.ExposeRawResponse(true),
                (settings, stream) => FakeResponse.Bad(settings, response: stream)
                ))
         this.ShouldStreamOfCopy(request, false);
 }
コード例 #7
0
		public void Typed_Ok_DiscardResponse(object responseValue)
		{
			using (var request = new MemorySetup<StandardResponse>(
				responseValue,
				settings => settings.ExposeRawResponse(false),
				(settings, stream) => FakeResponse.Ok(settings, response: stream)
			))
				this.ShouldDirectlyStream(request);
		}
コード例 #8
0
 public void ByteArray_Bad_KeepResponse(object responseValue)
 {
     using (var request = new MemorySetup <byte[]>(
                responseValue,
                settings => settings.ExposeRawResponse(true),
                (settings, stream) => FakeResponse.Bad(settings, response: stream)
                ))
         this.ShouldStreamOfCopy(request, success: false);
 }
コード例 #9
0
 public void ByteArray_Ok_DiscardResponse(object responseValue)
 {
     using (var request = new MemorySetup <byte[]>(
                responseValue,
                settings => settings.ExposeRawResponse(false),
                (settings, stream) => FakeResponse.Ok(settings, response: stream)
                ))
         this.ShouldStreamOfCopy(request, keepRaw: false);
 }
コード例 #10
0
		public void DynamicDictionary_Ok_KeepResponse(object responseValue)
		{
			using (var request = new MemorySetup<DynamicDictionary>(
				responseValue,
				settings => settings.ExposeRawResponse(true),
				(settings, stream) => FakeResponse.Ok(settings, response: stream),
				client => client.Info()
			))
				this.ShouldStreamOfCopy(request);
		}
コード例 #11
0
		public void DynamicDictionary_Ok_DiscardResponse(object responseValue)
		{
			using (var request = new MemorySetup<DynamicDictionary>(
				responseValue,
				settings => settings.ExposeRawResponse(false),
				(settings, stream) => FakeResponse.Ok(settings, response: stream),
				client => client.Info()
			))
				this.ShouldDirectlyStream(request);
		}
コード例 #12
0
 public void DynamicDictionary_Bad_DiscardResponse(object responseValue)
 {
     using (var request = new MemorySetup <DynamicDictionary>(
                responseValue,
                settings => settings.ExposeRawResponse(false),
                (settings, stream) => FakeResponse.Bad(settings, response: stream),
                client => client.Info()
                ))
         this.ShouldDirectlyStream(request, false);
 }
コード例 #13
0
 public void VoidResponse_Bad_DiscardResponse(object responseValue)
 {
     using (var request = new MemorySetup <VoidResponse>(
                responseValue,
                settings => settings.ExposeRawResponse(false),
                (settings, stream) => FakeResponse.Bad(settings, response: stream)
                ))
         //voidResponse NEVER reads the body so Raw is always false
         this.ShouldDirectlyStream(request, success: false);
 }
コード例 #14
0
 public void DynamicDictionary_Ok_KeepResponse(object responseValue)
 {
     using (var request = new MemorySetup <DynamicDictionary>(
                responseValue,
                settings => settings.ExposeRawResponse(true),
                (settings, stream) => FakeResponse.Ok(settings, response: stream),
                client => client.Info()
                ))
         this.ShouldStreamOfCopy(request);
 }
コード例 #15
0
 public void VoidResponse_Bad_KeepResponse(object responseValue)
 {
     using (var request = new MemorySetup <VoidResponse>(
                responseValue,
                settings => settings.ExposeRawResponse(true),
                (settings, stream) => FakeResponse.Bad(settings, response: stream)
                ))
         //voidResponse NEVER reads the body so Raw is always false
         //and no intermediate stream should be created
         this.ShouldDirectlyStream(request, success: false);
 }
コード例 #16
0
		public void ByteArray_Ok_DiscardResponse(object responseValue)
		{
			using (var request = new MemorySetup<byte[]>(
				responseValue,
				settings => settings.ExposeRawResponse(false),
				(settings, stream) => FakeResponse.Ok(settings, response: stream)
			))
				this.ShouldStreamOfCopy(request, keepRaw: false);
			
		}
コード例 #17
0
		public void String_Ok_KeepResponse(object responseValue)
		{
			using (var request = new MemorySetup<string>(
				responseValue,
				settings => settings.ExposeRawResponse(true),
				(settings, stream) => FakeResponse.Ok(settings, response: stream)
			))
				this.ShouldStreamOfCopy(request);
			
		}
コード例 #18
0
		public void String_Bad_DiscardResponse(object responseValue)
		{
			using (var request = new MemorySetup<string>(
				responseValue,
				settings => settings.ExposeRawResponse(false),
				(settings, stream) => FakeResponse.Bad(settings, response: stream)
			))
				this.ShouldStreamOfCopy(request, success: false, keepRaw: false);
			
		}
コード例 #19
0
		public void Stream_Bad_KeepResponse(object responseValue)
		{
			using (var request = new MemorySetup<Stream>(
				responseValue,
				settings => settings.ExposeRawResponse(true),
				(settings, stream) => FakeResponse.Bad(settings, response: stream)
			))
				this.ShouldDirectlyStream(request, success: false);
		}
コード例 #20
0
		public void VoidResponse_Bad_DiscardResponse(object responseValue)
		{
			using (var request = new MemorySetup<VoidResponse>(
				responseValue,
				settings => settings.ExposeRawResponse(false),
				(settings, stream) => FakeResponse.Bad(settings, response: stream)
			))
				//voidResponse NEVER reads the body so Raw is always false
				this.ShouldDirectlyStream(request, success: false);
		}
コード例 #21
0
		public void VoidResponse_Bad_KeepResponse(object responseValue)
		{
			using (var request = new MemorySetup<VoidResponse>(
				responseValue,
				settings => settings.ExposeRawResponse(true),
				(settings, stream) => FakeResponse.Bad(settings, response: stream)
			))
				//voidResponse NEVER reads the body so Raw is always false
				//and no intermediate stream should be created
				this.ShouldDirectlyStream(request, success: false);
		}
コード例 #22
0
		public void ByteArray_Bad_KeepResponse(object responseValue)
		{
			using (var request = new MemorySetup<byte[]>(
				responseValue,
				settings => settings.ExposeRawResponse(true),
				(settings, stream) => FakeResponse.Bad(settings, response: stream)
			))
				this.ShouldStreamOfCopy(request, success: false);
		}