Adding update endpoint for location, player, spawnable, and user
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user