public async Task GetUserName_Test() { var store = new ElasticUserStore <ElasticUser, ElasticRole>(_nestClient, new ElasticOptions { UsersIndex = _userIndex }); const string expected = "test1"; var user = new ElasticUser { Id = "test1", UserName = "******", PasswordHash = "phash", Logins = new List <ElasticUserLogin> { new ElasticUserLogin(new UserLoginInfo("prov1", "key", "test1")), new ElasticUserLogin(new UserLoginInfo("prov2", "key2", "test1")) }, Email = new ElasticConfirmation("*****@*****.**") }; var actual = await store.GetUserNameAsync(user, NoCancellationToken); Assert.Equal(expected, actual); }