Skip to content

Commit

Permalink
remove a test that doesn't have a point if we don't error on sanitize…
Browse files Browse the repository at this point in the history
…r removal
  • Loading branch information
scbedd committed Aug 2, 2024
1 parent d420268 commit 8d4d221
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions tools/test-proxy/Azure.Sdk.Tools.TestProxy.Tests/AdminTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -938,32 +938,6 @@ public async Task TestAddSanitizerContinuesWithTwoRequiredParams()
Assert.Equal(targetString, actualTargetString);
}

[Fact]
public async Task RemoveSanitizerErrorsForInvalidIdOnRecording()
{
RecordingHandler testRecordingHandler = new RecordingHandler(Directory.GetCurrentDirectory());
var httpContext = new DefaultHttpContext();
await testRecordingHandler.StartPlaybackAsync("Test.RecordEntries/oauth_request_with_variables.json", httpContext.Response);
var recordingId = httpContext.Response.Headers["x-recording-id"];
httpContext.Request.Headers["x-recording-id"] = recordingId;
httpContext.Response.Body = new MemoryStream();
var controller = new Admin(testRecordingHandler, _nullLogger)
{
ControllerContext = new ControllerContext()
{
HttpContext = httpContext
}
};

var testSet = new RemoveSanitizerList() { Sanitizers = new List<string>() { "0" } };

var assertion = await Assert.ThrowsAsync<HttpException>(
async () => await controller.RemoveSanitizers(testSet)
);

Assert.Contains("Unable to remove 1 sanitizer. Detailed list follows: \nThe requested sanitizer for removal \"0\" is not active on recording/playback with id", assertion.Message);
}

[Fact]
public async Task RemoveSanitizersSilentlyAcceptsInvalidSanitizer()
{
Expand Down

0 comments on commit 8d4d221

Please sign in to comment.