Exemplo n.º 1
0
        public void TheGamesDB_GetGamesListCall()
        {
            Dictionary <SearchParameters, object> searchParameters = new Dictionary <SearchParameters, object>()
            {
                { SearchParameters.name, "Street%20Rod" }
            };
            GetGamesList list = gamesDBList.MakeWebCall <GetGamesList>(searchParameters);

            Assert.IsFalse(list.Games.Length <= 0);
        }
Exemplo n.º 2
0
        private void GetGamesButton_Click(object sender, EventArgs e)
        {
            GetGamesList getgames   = new GetGamesList();
            string       XMLmessage = MessageProject.Message.messageIntoXML(getgames);

            // SERVER STUFF

            A : Console.Clear();
            Console.Write("Enter host IP address: ");
            string ip = Console.ReadLine();

            Console.Write("Enter port: ");
            Int32 portValue = Convert.ToInt32(Console.ReadLine());

            master = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

            //IPEndPoint ipe = new IPEndPoint(IPAddress.Parse(ip), 4242);
            IPEndPoint ipe = new IPEndPoint(IPAddress.Parse(ip), portValue);

            try
            {
                master.Connect(ipe);
            }
            catch
            {
                Console.WriteLine("Could not connect");
                Thread.Sleep(1000);
                goto A;
            }

            Console.Clear();

            Thread t = new Thread(DataIn);

            t.Start();



            byte[] toBytes = Encoding.ASCII.GetBytes(XMLmessage);

            master.Send(toBytes);
        }
Exemplo n.º 3
0
        public void TheGamesDB_GetGamesListDeserialize()
        {
            GetGamesList list = gamesDBList.DeserializeOnly <GetGamesList>(Properties.Resources.Interfaces_TheGamesDB_GetGamesList);

            Assert.IsTrue(list.Games.Length > 0);
        }