public async Task UserLogin_ExistingUser_WrongPassword_Fail() { var user = await _client.LoginAsync("account", "1234"); _client.ChannelRef.WithNoReply().Close(); _client = new MockClient(_clusterContext); var exception = await Record.ExceptionAsync(() => _client.LoginAsync("account", "12345")); Assert.IsType <ResultException>(exception); Assert.Equal(ResultCodeType.LoginFailedIncorrectPassword, ((ResultException)exception).ResultCode); }
public async Task UserLogin_ExistingUser_Succeed() { var user = await _client.LoginAsync("account", "1234"); _client.ChannelRef.WithNoReply().Close(); await Task.Delay(100); _client = new MockClient(_clusterContext); var user2 = await _client.LoginAsync("account", "1234"); Assert.NotNull(user2); }
public static async Task <MockClient[]> PrepareLoginedClients(ClusterNodeContext context, int count) { var clients = new List <MockClient>(); for (var i = 0; i < count; i++) { var client = new MockClient(context); await client.LoginAsync("test" + i, "1234"); clients.Add(client); } return(clients.ToArray()); }
public async Task UserLogin_NewUser_Succeed() { var user = await _client.LoginAsync("account", "1234"); Assert.NotNull(user); }