Пример #1
0
 public UserLoginActorTest(ITestOutputHelper output, ClusterContextFixture clusterContext)
     : base(output: output)
 {
     clusterContext.Initialize(Sys);
     _clusterContext = clusterContext.Context;
     _client         = new MockClient(_clusterContext);
 }
Пример #2
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);
        }
Пример #3
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);
        }
Пример #4
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());
        }
Пример #5
0
 private Task <MockClient[]> PrepareLoginedClients(int count) =>
 MockClient.PrepareLoginedClients(_clusterContext, count);