-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from robertbjarum/main
Added methods to assert Method Not Allowed (405) Responses
- Loading branch information
Showing
14 changed files
with
195 additions
and
1 deletion.
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
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
17 changes: 17 additions & 0 deletions
17
tests/Ardalis.HttpClientTestExtensions.Api/Endpoints/MethodNotAllowedEndpoints/NoDelete.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Ardalis.ApiEndpoints; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Ardalis.HttpClientTestExtensions.Api.Endpoints.MethodNotAllowedEndpoints; | ||
|
||
public class NoDelete : EndpointBaseSync | ||
.WithoutRequest | ||
.WithResult<NoContentResult> | ||
|
||
{ | ||
[Route("/nodelete")] | ||
[AcceptVerbs("GET", "PUT", "POST")] | ||
public override NoContentResult Handle() | ||
{ | ||
return NoContent(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Ardalis.HttpClientTestExtensions.Api/Endpoints/MethodNotAllowedEndpoints/NoGet.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Ardalis.ApiEndpoints; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Ardalis.HttpClientTestExtensions.Api.Endpoints.MethodNotAllowedEndpoints; | ||
|
||
public class NoGet : EndpointBaseSync | ||
.WithoutRequest | ||
.WithResult<NoContentResult> | ||
|
||
{ | ||
[Route("/noget")] | ||
[AcceptVerbs("DELETE", "PUT", "POST")] | ||
public override NoContentResult Handle() | ||
{ | ||
return NoContent(); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Ardalis.HttpClientTestExtensions.Api/Endpoints/MethodNotAllowedEndpoints/NoPost.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using Ardalis.ApiEndpoints; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Ardalis.HttpClientTestExtensions.Api.Endpoints.ErrorEndpoints; | ||
|
||
public class NoPost : EndpointBaseSync | ||
.WithoutRequest | ||
.WithResult<NoContentResult> | ||
|
||
{ | ||
[Route("/nopost")] | ||
[AcceptVerbs("DELETE", "PUT", "GET")] | ||
public override NoContentResult Handle() | ||
{ | ||
return NoContent(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/Ardalis.HttpClientTestExtensions.Api/Endpoints/MethodNotAllowedEndpoints/NoPut.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using Ardalis.ApiEndpoints; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace Ardalis.HttpClientTestExtensions.Api.Endpoints.ErrorEndpoints; | ||
|
||
public class NoPut : EndpointBaseSync | ||
.WithoutRequest | ||
.WithResult<NoContentResult> | ||
|
||
{ | ||
[Route("/noput")] | ||
[AcceptVerbs("DELETE", "GET", "POST")] | ||
public override NoContentResult Handle() | ||
{ | ||
return NoContent(); | ||
} | ||
|
||
} |
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
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