HttpContext

This commit is contained in:
Stef Heyenrath
2026-02-08 19:19:19 +01:00
parent 88df9af9df
commit dff55e175b
40 changed files with 236 additions and 231 deletions

View File

@@ -4,6 +4,7 @@ using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Moq;
using NFluent;
using WireMock.Models;
@@ -56,7 +57,7 @@ public class ResponseWithProxyTests : IDisposable
var responseBuilder = Response.Create().WithProxy(_server.Urls[0]);
// Act
var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings);
var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings);
// Assert
Check.That(request.ProxyUrl).IsNotNull();
@@ -84,7 +85,7 @@ public class ResponseWithProxyTests : IDisposable
// Act
var request = new RequestMessage(new UrlDetails($"{_server.Urls[0]}/{_guid}"), "GET", ClientIp);
Check.ThatCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings)).Throws<HttpRequestException>();
Check.ThatCode(() => responseBuilder.ProvideResponseAsync(_mappingMock.Object, Mock.Of<HttpContext>(), request, _settings)).Throws<HttpRequestException>();
}
public void Dispose()