begin writing tests for controllers
This commit is contained in:
@@ -31,7 +31,7 @@ namespace server.Controllers.v1
|
||||
[ProducesResponseType(typeof(List<Character>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<List<Character>>> GetCharactersAsync([FromQuery] CharacterFilter? filter)
|
||||
public async Task<IActionResult> GetCharactersAsync([FromQuery] CharacterFilter? filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -60,7 +60,7 @@ namespace server.Controllers.v1
|
||||
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<Character>> GetCharacterByIdAsync(string id)
|
||||
public async Task<IActionResult> GetCharacterByIdAsync(string id)
|
||||
{
|
||||
|
||||
if (!ObjectId.TryParse(id, out _))
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace server.Controllers.v1
|
||||
[ProducesResponseType(typeof(List<Episode>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<List<Episode>>> GetEpisodesAsync([FromQuery] EpisodeFilter? filter)
|
||||
public async Task<IActionResult> GetEpisodesAsync([FromQuery] EpisodeFilter? filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -59,7 +59,7 @@ namespace server.Controllers.v1
|
||||
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<Episode>> GetEpisodeByNumberAsync(int number)
|
||||
public async Task<IActionResult> GetEpisodeByNumberAsync(int number)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace server.Controllers.v1
|
||||
[ProducesResponseType(typeof(List<Quote>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<List<Quote>>> GetQuotesAsync([FromQuery] QuoteFilter? filter)
|
||||
public async Task<IActionResult> GetQuotesAsync([FromQuery] QuoteFilter? filter)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -61,7 +61,7 @@ namespace server.Controllers.v1
|
||||
[ProducesResponseType(typeof(ValidationProblemDetails), StatusCodes.Status400BadRequest)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<Quote>> GetQuoteByIdAsync(string id)
|
||||
public async Task<IActionResult> GetQuoteByIdAsync(string id)
|
||||
{
|
||||
|
||||
if (!ObjectId.TryParse(id, out _))
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace server.Controllers.v1
|
||||
[HttpGet]
|
||||
[ProducesResponseType(typeof(List<Season>), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<List<Season>>> GetSeasonsAsync()
|
||||
public async Task<IActionResult> GetSeasonsAsync()
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace server.Controllers.v1
|
||||
[ProducesResponseType(typeof(Season), StatusCodes.Status200OK)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)]
|
||||
[ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status500InternalServerError)]
|
||||
public async Task<ActionResult<Season>> GetSeasonByNumberAsync(int number)
|
||||
public async Task<IActionResult> GetSeasonByNumberAsync(int number)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user