コード例 #1
0
        public async Task SetsContentTypeHeader(JSendCreatedResult <Model> result)
        {
            // Exercise system
            var message = await result.ExecuteAsync(new CancellationToken());

            // Verify outcome
            message.Content.Headers.ContentType.MediaType.Should().Be("application/json");
        }
コード例 #2
0
        public async Task SetsLocationHeader(JSendCreatedResult <Model> result)
        {
            // Exercise system
            var message = await result.ExecuteAsync(new CancellationToken());

            // Verify outcome
            message.Headers.Location.Should().Be(result.Location);
        }
コード例 #3
0
        public async Task SetsStatusCode(JSendCreatedResult <Model> result)
        {
            // Exercise system
            var message = await result.ExecuteAsync(new CancellationToken());

            // Verify outcome
            message.StatusCode.Should().Be(result.StatusCode);
        }
コード例 #4
0
        public async Task ResponseIsSerializedIntoBody(JSendCreatedResult <Model> result)
        {
            // Fixture setup
            var serializedResponse = JsonConvert.SerializeObject(result.Response);
            // Exercise system
            var httpResponse = await result.ExecuteAsync(new CancellationToken());

            // Verify outcome
            var content = await httpResponse.Content.ReadAsStringAsync();

            content.Should().Be(serializedResponse);
        }
コード例 #5
0
 public async Task ResponseIsSerializedIntoBody(JSendCreatedResult<Model> result)
 {
     // Fixture setup
     var serializedResponse = JsonConvert.SerializeObject(result.Response);
     // Exercise system
     var httpResponseMessage = await result.ExecuteAsync(new CancellationToken());
     // Verify outcome
     var content = await httpResponseMessage.Content.ReadAsStringAsync();
     content.Should().Be(serializedResponse);
 }
コード例 #6
0
 public async Task SetsLocationHeader(JSendCreatedResult<Model> result)
 {
     // Exercise system
     var message = await result.ExecuteAsync(new CancellationToken());
     // Verify outcome
     message.Headers.Location.Should().Be(result.Location);
 }
コード例 #7
0
 public async Task SetsContentTypeHeader(JSendCreatedResult<Model> result)
 {
     // Exercise system
     var message = await result.ExecuteAsync(new CancellationToken());
     // Verify outcome
     message.Content.Headers.ContentType.MediaType.Should().Be("application/json");
 }
コード例 #8
0
 public async Task SetsStatusCode(JSendCreatedResult<Model> result)
 {
     // Exercise system
     var message = await result.ExecuteAsync(new CancellationToken());
     // Verify outcome
     message.StatusCode.Should().Be(result.StatusCode);
 }