Use sorted username dropdown for character owner editing
This commit is contained in:
@@ -56,4 +56,22 @@ public sealed class ServiceAuthTests
|
||||
Assert.True(login.Succeeded);
|
||||
Assert.Equal(2, hasher.HashCalls);
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void GetUsernames_RequiresAuthAndReturnsSortedUsernames()
|
||||
{
|
||||
using var harness = ServiceTestSupport.CreateHarness();
|
||||
var service = harness.Service;
|
||||
|
||||
service.Register("zoe", "Password123", "Zoe");
|
||||
service.Register("amy", "Password123", "Amy");
|
||||
service.Register("bob", "Password123", "Bob");
|
||||
|
||||
var unauthorized = service.GetUsernames(string.Empty);
|
||||
Assert.False(unauthorized.Succeeded);
|
||||
|
||||
var session = ServiceTestSupport.GetValue(service.Login("bob", "Password123")).SessionToken;
|
||||
var usernames = ServiceTestSupport.GetValue(service.GetUsernames(session));
|
||||
Assert.Equal(["amy", "bob", "zoe"], usernames);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user