-
-
Notifications
You must be signed in to change notification settings - Fork 206
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into dispose-of-client-should-only-flush
- Loading branch information
Showing
10 changed files
with
73 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Web; | ||
|
||
public static class HttpContextBuilder | ||
{ | ||
public static HttpContext Build(int responseStatusCode = 200) | ||
{ | ||
return new HttpContext( | ||
new HttpRequest("test", "http://test/the/path", null), | ||
new HttpResponse(TextWriter.Null) | ||
{ | ||
StatusCode = responseStatusCode | ||
}) | ||
{ | ||
ApplicationInstance = new HttpApplication() | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System.Web; | ||
|
||
public abstract class HttpContextTest : | ||
IDisposable | ||
{ | ||
private HttpContext _context; | ||
|
||
protected HttpContextTest() | ||
{ | ||
HttpContext.Current = Context = HttpContextBuilder.Build(); | ||
} | ||
|
||
public HttpContext Context | ||
{ | ||
get => _context; | ||
set => HttpContext.Current = _context = value; | ||
} | ||
|
||
public void Dispose() | ||
{ | ||
HttpContext.Current = null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 7 additions & 30 deletions
37
test/Sentry.AspNet.Tests/Internal/SystemWebVersionLocatorTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
test/Sentry.AspNet.Tests/SentryAspNetOptionsExtensionsTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters