diff --git a/CommBank-Server/Models/Goal.cs b/CommBank-Server/Models/Goal.cs index 77ff1ad5..b38f057c 100644 --- a/CommBank-Server/Models/Goal.cs +++ b/CommBank-Server/Models/Goal.cs @@ -27,4 +27,5 @@ public class Goal [BsonRepresentation(BsonType.ObjectId)] public string? UserId { get; set; } + public string? Icon { get; set; } } \ No newline at end of file diff --git a/CommBank-Server/Secrets.json b/CommBank-Server/Secrets.json deleted file mode 100644 index 0e5bf949..00000000 --- a/CommBank-Server/Secrets.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ConnectionStrings": { - "CommBank": "{CONNECTION_STRING}" - } -} \ No newline at end of file diff --git a/CommBank.Tests/GoalControllerTests.cs b/CommBank.Tests/GoalControllerTests.cs index 8380181f..e16c4545 100644 --- a/CommBank.Tests/GoalControllerTests.cs +++ b/CommBank.Tests/GoalControllerTests.cs @@ -63,12 +63,25 @@ public async void Get() } [Fact] - public async void GetForUser() - { - // Arrange - - // Act - - // Assert - } +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); + + var httpContext = new Microsoft.AspNetCore.Http.DefaultHttpContext(); + controller.ControllerContext.HttpContext = httpContext; + + // Act + var result = await controller.GetForUser(users[0].Id!); + + // Assert + Assert.NotNull(result); + Assert.IsAssignableFrom>(result); +} } \ No newline at end of file