add test dans l'api
continuous-integration/drone/push Build is failing Details

pull/1/head
Bastien OLLIER 2 years ago
commit 3294798262

@ -1,20 +1,18 @@
using Microsoft.AspNetCore.Mvc;
using Model;
using StubLib;
using System.Xml.Linq;
using static StubLib.StubData;
// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace apiLOL.Controllers
{
[ApiController]
[Route("api/[controller]")]
[Route("api/v1/[controller]")]
[ApiVersion("1.0")]
public class ControllerChampions : Controller
{
private readonly IDataManager data;
private readonly ILogger _logger;
public ControllerChampions(IDataManager manager, ILogger<ControllerChampions> log)
{
data = manager;
@ -76,7 +74,7 @@ namespace apiLOL.Controllers
// PUT api/<ControllerLol>/5
[HttpPut("{name}")]
public async Task<IActionResult> Put( string name, string bio)
public async Task<IActionResult> Put(string name, string bio)
{
_logger.LogInformation($"methode Put de ControllerChampions appelée avec le paramètre name: {name} et bio: {bio}");

@ -1,33 +0,0 @@
using Microsoft.AspNetCore.Mvc;
namespace apiLOL.Controllers
{
[ApiController]
[Route("[controller]")]
public class WeatherForecastController : ControllerBase
{
private static readonly string[] Summaries = new[]
{
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
};
private readonly ILogger<WeatherForecastController> _logger;
public WeatherForecastController(ILogger<WeatherForecastController> logger)
{
_logger = logger;
}
[HttpGet(Name = "GetWeatherForecast")]
public IEnumerable<WeatherForecast> Get()
{
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
{
Date = DateTime.Now.AddDays(index),
TemperatureC = Random.Shared.Next(-20, 55),
Summary = Summaries[Random.Shared.Next(Summaries.Length)]
})
.ToArray();
}
}
}

@ -1,13 +0,0 @@
namespace apiLOL
{
public class WeatherForecast
{
public DateTime Date { get; set; }
public int TemperatureC { get; set; }
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
public string? Summary { get; set; }
}
}

@ -7,6 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning" Version="5.0.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.InMemory" Version="7.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="7.0.2" />

Loading…
Cancel
Save