Skip to content
This repository was archived by the owner on Nov 22, 2018. It is now read-only.

Commit b66a9ed

Browse files
committed
Updates after rebase
1 parent a63cf4b commit b66a9ed

File tree

1 file changed

+2
-18
lines changed

1 file changed

+2
-18
lines changed

test/Microsoft.AspNetCore.ResponseCaching.Tests/ResponseCachingTests.cs

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -689,15 +689,7 @@ public async void ServesCachedContent_IfIfModifiedSince_NotSatisfied()
689689
client.DefaultRequestHeaders.IfUnmodifiedSince = DateTimeOffset.MinValue;
690690
var subsequentResponse = await client.GetAsync("");
691691

692-
initialResponse.EnsureSuccessStatusCode();
693-
subsequentResponse.EnsureSuccessStatusCode();
694-
695-
foreach (var header in initialResponse.Headers)
696-
{
697-
Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key));
698-
}
699-
Assert.True(subsequentResponse.Headers.Contains(HeaderNames.Age));
700-
Assert.Equal(await initialResponse.Content.ReadAsStringAsync(), await subsequentResponse.Content.ReadAsStringAsync());
692+
await AssertResponseCachedAsync(initialResponse, subsequentResponse);
701693
}
702694
}
703695

@@ -756,15 +748,7 @@ public async void ServesCachedContent_IfIfNoneMatch_NotSatisfied()
756748
client.DefaultRequestHeaders.IfNoneMatch.Add(new System.Net.Http.Headers.EntityTagHeaderValue("\"E2\""));
757749
var subsequentResponse = await client.GetAsync("");
758750

759-
initialResponse.EnsureSuccessStatusCode();
760-
subsequentResponse.EnsureSuccessStatusCode();
761-
762-
foreach (var header in initialResponse.Headers)
763-
{
764-
Assert.Equal(initialResponse.Headers.GetValues(header.Key), subsequentResponse.Headers.GetValues(header.Key));
765-
}
766-
Assert.True(subsequentResponse.Headers.Contains(HeaderNames.Age));
767-
Assert.Equal(await initialResponse.Content.ReadAsStringAsync(), await subsequentResponse.Content.ReadAsStringAsync());
751+
await AssertResponseCachedAsync(initialResponse, subsequentResponse);
768752
}
769753
}
770754

0 commit comments

Comments
 (0)