コード例 #1
0
        public async Task Create_New_Client_And_Change_To_Room2()
        {
            _secondClientSide = new RunningClient(new ConnectionDomainService(), new MessageHandleDomainService());
            _secondClient     = await _secondClientSide.ConnectAsync();

            await _secondClientSide.SendTestAsync(_secondClient, "/Name Gabriel");

            await _secondClientSide.SendTestAsync(_secondClient, "/CR Room2");

            var response = await _secondClientSide.SendTestAsync(_secondClient, "/LU");

            Assert.Contains("Luiz", response);
        }
コード例 #2
0
        public async Task Send_SameName_Client()
        {
            var    clientSide = new RunningClient(new ConnectionDomainService(), new MessageHandleDomainService());
            Client client     = await clientSide.ConnectAsync();

            var response = await clientSide.SendTestAsync(client, "/Name Luiz");

            Assert.Equal("Sorry, the nickname Luiz is already taken, Please choose a differente one", response);
        }
コード例 #3
0
        public async Task Create_New_Client_And_Try_Send_Message_From_Other_Room()
        {
            _thirdClientSide = new RunningClient(new ConnectionDomainService(), new MessageHandleDomainService());
            _thirdCLient     = await _thirdClientSide.ConnectAsync();

            await _thirdClientSide.SendTestAsync(_thirdCLient, "/Name Carol");

            var response = await _secondClientSide.SendTestAsync(_secondClient, "/P Carol oi Carol");

            Assert.Equal("The client you wanted to talk doesnt exists or isn't in the same room as you.", response);
        }
コード例 #4
0
        public async Task Gabriel_Send_Public_Message_To_Luiz()
        {
            var response = await _secondClientSide.SendTestAsync(_secondClient, "/P Luiz e ae Luiz");

            Assert.Equal("Gabriel says to Luiz: e ae Luiz", response);
        }
コード例 #5
0
        public async Task Send_Name_Client()
        {
            var response = await _firstClientSide.SendTestAsync(_firstClient, "/Name Luiz");

            Assert.Equal("You were registered Succesfully!", response);
        }