예제 #1
0
        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);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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());
        }
예제 #4
0
        public async Task UserLogin_NewUser_Succeed()
        {
            var user = await _client.LoginAsync("account", "1234");

            Assert.NotNull(user);
        }