Update NoContentTestController_Tests.cs

pull/6120/head
maliming 5 years ago committed by GitHub
parent 4b9608e584
commit 0a1dd5e991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -10,56 +10,49 @@ namespace Volo.Abp.AspNetCore.Mvc.Response
[Fact]
public async Task Should_Set_No_Content_For_Void_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestMethod", HttpStatusCode.NoContent)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestMethod", HttpStatusCode.NoContent);
result.StatusCode.ShouldBe(HttpStatusCode.NoContent);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Not_Void_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestMethodWithReturn")
;
var result = await GetResponseAsync("/api/NoContent-Test/TestMethodWithReturn");
result.StatusCode.ShouldBe(HttpStatusCode.OK);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Custom_Http_Status_Code_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestCustomHttpStatusCodeMethod", HttpStatusCode.Redirect)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestCustomHttpStatusCodeMethod", HttpStatusCode.Redirect);
result.StatusCode.ShouldBe(HttpStatusCode.Redirect);
}
[Fact]
public async Task Should_Set_No_Content_For_Task_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethod", HttpStatusCode.NoContent)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethod", HttpStatusCode.NoContent);
result.StatusCode.ShouldBe(HttpStatusCode.NoContent);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Not_Task_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethodWithReturn")
;
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethodWithReturn");
result.StatusCode.ShouldBe(HttpStatusCode.OK);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Custom_Http_Status_Code_Async_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncCustomHttpStatusCodeMethod", HttpStatusCode.Redirect)
;
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncCustomHttpStatusCodeMethod", HttpStatusCode.Redirect);
result.StatusCode.ShouldBe(HttpStatusCode.Redirect);
}
[Fact]
public async Task Should_Not_Set_No_Content_For_Custom_Result_Filter_Async_Action()
{
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethodWithResultFilter")
;
var result = await GetResponseAsync("/api/NoContent-Test/TestAsyncMethodWithResultFilter");
result.StatusCode.ShouldBe(HttpStatusCode.OK);
}
}

Loading…
Cancel
Save