예제 #1
0
        public void ClientConnectionUdpAddListener()
        {
            //---------------------------------------------------------------------
            //Setup
            //---------------------------------------------------------------------
            UDP_Config config;

            config.address = "127.0.0.1";
            config.port    = 4527;

            DotNetserialization serializer = new DotNetserialization();

            ClientLibrary.ClientListenerUDP   listener   = new ClientLibrary.ClientListenerUDP(config);
            ClientLibrary.ClientConnectionUDP connection = new ClientLibrary.ClientConnectionUDP("Test_Connection", "Tester");
            connection.AddSerializer(serializer);

            //---------------------------------------------------------------------
            //Run Test
            //---------------------------------------------------------------------
            connection.AddListener(listener);

            //---------------------------------------------------------------------
            //Gather Output
            //---------------------------------------------------------------------

            //---------------------------------------------------------------------
            //Assert
            //---------------------------------------------------------------------
        }
예제 #2
0
        public void ClientConnectionUdpSend()
        {
            //---------------------------------------------------------------------
            //Setup
            //---------------------------------------------------------------------
            UDP_Config config;

            config.address = "127.0.0.1";
            config.port    = 4522;

            DotNetserialization serializer = new DotNetserialization();

            ClientLibrary.ClientListenerUDP   listener   = new ClientLibrary.ClientListenerUDP(config);
            ClientLibrary.ClientConnectionUDP connection = new ClientLibrary.ClientConnectionUDP("Test_Connection", "Tester");
            connection.AddListener(listener);
            connection.AddSerializer(serializer);
            connection.Start();

            ChatMessagePacket packet = new ChatMessagePacket("This is a test", "Tester");

            //---------------------------------------------------------------------
            //Run Test
            //---------------------------------------------------------------------
            connection.Send(packet);

            //---------------------------------------------------------------------
            //Gather Output
            //---------------------------------------------------------------------

            //---------------------------------------------------------------------
            //Assert
            //---------------------------------------------------------------------
        }
예제 #3
0
        public void ClientConnectionUdpConstructor()
        {
            //---------------------------------------------------------------------
            //Setup
            //---------------------------------------------------------------------
            ClientLibrary.ClientConnectionUDP connection;

            //---------------------------------------------------------------------
            //Run Test
            //---------------------------------------------------------------------
            connection = new ClientLibrary.ClientConnectionUDP("Test_Connection", "Tester");

            //---------------------------------------------------------------------
            //Gather Output
            //---------------------------------------------------------------------

            //---------------------------------------------------------------------
            //Assert
            //---------------------------------------------------------------------
        }
예제 #4
0
        public void ClientClearMessage()
        {
            //---------------------------------------------------------------------
            //Setup
            //---------------------------------------------------------------------
            ClientLibrary.ClientConnectionUDP connection = new ClientLibrary.ClientConnectionUDP("Test_Connection", "Tester");
            ClientLibrary.Client client = new ClientLibrary.Client("Tester");
            client.AddConnection(connection);

            //---------------------------------------------------------------------
            //Run Test
            //---------------------------------------------------------------------
            client.ClearMessages("Test_Connection");

            //---------------------------------------------------------------------
            //Gather Output
            //---------------------------------------------------------------------

            //---------------------------------------------------------------------
            //Assert
            //---------------------------------------------------------------------
        }