File tree Expand file tree Collapse file tree
tests/Sitecore.AspNetCore.SDK.RenderingEngine.Integration.Tests/Fixtures Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111
1212namespace Sitecore . AspNetCore . SDK . RenderingEngine . Integration . Tests . Fixtures ;
1313
14- public class RequestHeadersValidationFixture ( TestWebApplicationFactory < TestWebApplicationProgram > factory ) : IClassFixture < TestWebApplicationFactory < TestWebApplicationProgram > > , IDisposable
14+ public class RequestHeadersValidationFixture : IClassFixture < TestWebApplicationFactory < TestWebApplicationProgram > > , IDisposable
1515{
16+ private readonly TestWebApplicationFactory < TestWebApplicationProgram > _factory ;
1617 private MockHttpMessageHandler _clientHandler = new ( ) ;
1718 private WebApplicationFactory < TestWebApplicationProgram > _appFactory = null ! ;
1819
20+ public RequestHeadersValidationFixture ( TestWebApplicationFactory < TestWebApplicationProgram > factory )
21+ {
22+ _factory = factory ;
23+ }
24+
1925 [ Fact ]
2026 public async Task Request_WithNonValidatedHeaders_HeadersAreProperlyValidated ( )
2127 {
2228 // Arrange
23- _appFactory = BuildRequestHeadersWebApplicationFactory ( new [ ] { "User-Agent" } ) ;
29+ _appFactory = BuildRequestHeadersWebApplicationFactory ( [ "User-Agent" ] ) ;
2430 ISitecoreLayoutClient layoutClient = _appFactory . Services . GetRequiredService < ISitecoreLayoutClient > ( ) ;
2531
2632 SitecoreLayoutRequest request = new SitecoreLayoutRequest ( )
@@ -71,7 +77,7 @@ private WebApplicationFactory<TestWebApplicationProgram> BuildRequestHeadersWebA
7177 { "User-Agent" , [ "site;core" ] }
7278 } ;
7379
74- return factory . WithWebHostBuilder ( builder =>
80+ return _factory . WithWebHostBuilder ( builder =>
7581 {
7682 builder . ConfigureServices ( services =>
7783 {
You can’t perform that action at this time.
0 commit comments