From ef8daf4bc742cdc3176b11906df8e997dd77db02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentina=20Cupa=C4=87?= Date: Sat, 18 Jun 2022 18:07:22 +0200 Subject: [PATCH] #26 REST API - BankAccountController --- .../Controllers/WeatherForecastController.cs | 6 +++--- src/Optivem.Kata.Banking.Web/Program.cs | 1 + .../Optivem.Kata.Banking.Test.csproj | 2 ++ .../System/BankAccountControllerSystemTest.cs | 20 ++++++++++++++++++- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs b/src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs index bf47123..01f69d4 100644 --- a/src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs +++ b/src/Optivem.Kata.Banking.Web/Controllers/WeatherForecastController.cs @@ -3,13 +3,13 @@ namespace Optivem.Kata.Banking.Web.Controllers { [ApiController] - [Route("[controller]")] + [Route("weather")] public class WeatherForecastController : ControllerBase { private static readonly string[] Summaries = new[] { - "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" - }; + "Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching" + }; private readonly ILogger _logger; diff --git a/src/Optivem.Kata.Banking.Web/Program.cs b/src/Optivem.Kata.Banking.Web/Program.cs index 48863a6..793082a 100644 --- a/src/Optivem.Kata.Banking.Web/Program.cs +++ b/src/Optivem.Kata.Banking.Web/Program.cs @@ -23,3 +23,4 @@ app.MapControllers(); app.Run(); +public partial class Program { } \ No newline at end of file diff --git a/test/Optivem.Kata.Banking.Test/Optivem.Kata.Banking.Test.csproj b/test/Optivem.Kata.Banking.Test/Optivem.Kata.Banking.Test.csproj index c5d7e55..73887e8 100644 --- a/test/Optivem.Kata.Banking.Test/Optivem.Kata.Banking.Test.csproj +++ b/test/Optivem.Kata.Banking.Test/Optivem.Kata.Banking.Test.csproj @@ -15,6 +15,7 @@ + @@ -34,6 +35,7 @@ + diff --git a/test/Optivem.Kata.Banking.Test/System/BankAccountControllerSystemTest.cs b/test/Optivem.Kata.Banking.Test/System/BankAccountControllerSystemTest.cs index 37c0595..dae8cc0 100644 --- a/test/Optivem.Kata.Banking.Test/System/BankAccountControllerSystemTest.cs +++ b/test/Optivem.Kata.Banking.Test/System/BankAccountControllerSystemTest.cs @@ -1,14 +1,32 @@ -using System; +using Microsoft.AspNetCore.Mvc.Testing; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Xunit; namespace Optivem.Kata.Banking.Test.System { public class BankAccountControllerSystemTest { + [Fact] + public async void Nothing() + { + var application = new WebApplicationFactory() + .WithWebHostBuilder(builder => + { + // TODO: VC: Configure + }); + + var client = application.CreateClient(); + + var response = await client.GetAsync("weather"); + + response.EnsureSuccessStatusCode(); + + } } }