public async Task Connect_Client() { _firstClientSide = new RunningClient(new ConnectionDomainService(), new MessageHandleDomainService()); _firstClient = await _firstClientSide.ConnectAsync(); Assert.True(_firstClient.Socket.Connected); }
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); }
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); }
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); }