Skip to content

Commit

Permalink
Merge pull request #728 from valadas/issue/702
Browse files Browse the repository at this point in the history
Fixed an async unit test
  • Loading branch information
valadas authored Aug 22, 2024
2 parents 767409f + e8926ff commit e1ad88b
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public static void ArgumentException_BadRequest(
}

[Fact]
public static void SystemException_DoesNotExposeDetails()
public async Task SystemException_DoesNotExposeDetails()
{
var attribute = new ModuleExceptionFilterAttribute();
var loggerSource = new Mock<ILoggerSource>();
Expand All @@ -72,7 +72,8 @@ public static void SystemException_DoesNotExposeDetails()
attribute.OnException(actionExecutedContext);

Assert.Equal(HttpStatusCode.InternalServerError, actionExecutedContext.Response.StatusCode);
Assert.NotEqual("Danger", actionExecutedContext.Response.Content.ReadAsStringAsync().Result);
var response = await actionExecutedContext.Response.Content.ReadAsStringAsync();
Assert.NotEqual("Danger", response);
}

public static IEnumerable<object[]> GetExceptionsTestData()
Expand Down

0 comments on commit e1ad88b

Please sign in to comment.