From e9ca41f0416896504b5b132d55076e4a80a13a25 Mon Sep 17 00:00:00 2001 From: onchonga-programmer Date: Sun, 5 Apr 2026 16:43:49 +0300 Subject: [PATCH 1/2] comm bank server --- CommBank-Server/Properties/launchSettings.json | 3 ++- CommBank-Server/Secrets.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CommBank-Server/Properties/launchSettings.json b/CommBank-Server/Properties/launchSettings.json index 2c9f444..c508600 100644 --- a/CommBank-Server/Properties/launchSettings.json +++ b/CommBank-Server/Properties/launchSettings.json @@ -13,8 +13,9 @@ "commandName": "Project", "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:11366;http://localhost:5203", + "applicationUrl": "https://localhost:7137;http://localhost:5203", "environmentVariables": { + "ASPNETCORE_HTTPS_PORT": "7137", "ASPNETCORE_ENVIRONMENT": "Development" } }, diff --git a/CommBank-Server/Secrets.json b/CommBank-Server/Secrets.json index 0e5bf94..81ada01 100644 --- a/CommBank-Server/Secrets.json +++ b/CommBank-Server/Secrets.json @@ -1,5 +1,5 @@ { "ConnectionStrings": { - "CommBank": "{CONNECTION_STRING}" + "CommBank": "mongodb+srv://bocha:@bochaberi.ej9iztf.mongodb.net/?appName=bochaberi" } } \ No newline at end of file From 902e6fe4cd057c854ac5ee86eb6ab9a0b4160b17 Mon Sep 17 00:00:00 2001 From: onchonga-programmer Date: Mon, 6 Apr 2026 01:12:48 +0300 Subject: [PATCH 2/2] Add icon field to Goal model and cover GetForUser route with tests --- CommBank.Tests/GoalControllerTests.cs | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/CommBank.Tests/GoalControllerTests.cs b/CommBank.Tests/GoalControllerTests.cs index 8380181..06ab15d 100644 --- a/CommBank.Tests/GoalControllerTests.cs +++ b/CommBank.Tests/GoalControllerTests.cs @@ -66,9 +66,22 @@ public async void Get() public async void GetForUser() { // Arrange - + var goals = collections.GetGoals(); + var users = collections.GetUsers(); + IGoalsService goalsService = new FakeGoalsService(goals, goals[0]); + IUsersService usersService = new FakeUsersService(users, users[0]); + GoalController controller = new(goalsService, usersService); + // Act - + var httpContext = new Microsoft.AspNetCore.Http.DefaultHttpContext(); + controller.ControllerContext.HttpContext = httpContext; + var result = await controller.GetForUser(users[0].Id!); + // Assert + foreach (Goal goal in result) + { + Assert.IsAssignableFrom(goal); + Assert.Equal(users[0].Id, goal.UserId); + } } -} \ No newline at end of file +}