Adding update endpoint for location, player, spawnable, and user

This commit is contained in:
hz
2025-06-09 10:23:43 -05:00
parent 7aa192d728
commit 44f57a1121
13 changed files with 174 additions and 0 deletions
+18
View File
@@ -43,4 +43,22 @@ public class UserControllerTests
Assert.IsType<NotFoundObjectResult>(result);
}
[Fact]
public async Task UpdateUser_NotFound()
{
var config = new ConfigurationBuilder()
.AddInMemoryCollection(new Dictionary<string,string>
{
{"MongoDB:ConnectionString","mongodb://localhost"},
{"MongoDB:DatabaseName","test"}
}).Build();
var mockService = new Mock<UserService>(config);
mockService.Setup(s => s.GetByUsernameAsync("no")).ReturnsAsync((User)null);
var controller = new UserController(mockService.Object);
var result = await controller.UpdateUser("no", new UpdateUserRequest { Email="e", Role="USER" });
Assert.IsType<NotFoundObjectResult>(result);
}
}