Example #1
0
        static void Main(string[] args)
        {
            Proxy udpProxy = new Proxy();

            udpProxy.Start();
            Console.ReadLine();
        }
Example #2
0
        public void TestCurrentWeather()
        {
            _driver.Navigate().GoToUrl("http://localhost:3000/");
            string title = _driver.Title;

            Assert.AreEqual("Weather Station", title);
            _proxy.Start();

            IWebElement temperatureElement = _driver.FindElement(By.Id("currentTemp"));
            IWebElement humidityeElement   = _driver.FindElement(By.Id("currentHumidity"));
            IWebElement pressureElement    = _driver.FindElement(By.Id("currentPressure"));

            Task task = Task.Delay(TimeSpan.FromSeconds(11));

            task.Wait();

            double temperature = double.Parse(temperatureElement.Text);
            double humidity    = double.Parse(humidityeElement.Text);
            double pressure    = double.Parse(pressureElement.Text);

            Task task2 = Task.Delay(TimeSpan.FromSeconds(8));

            task2.Wait();

            double temperature2 = double.Parse(temperatureElement.Text);
            double humidity2    = double.Parse(humidityeElement.Text);
            double pressure2    = double.Parse(pressureElement.Text);

            Assert.IsTrue(Math.Abs(temperature - temperature2) < 2);
            Assert.IsTrue(Math.Abs(humidity - humidity2) < 2);
            Assert.IsTrue(Math.Abs(pressure - pressure2) < 2);
        }
Example #3
0
        static void Main(string[] args)
        {
            Proxy proxy = new Proxy(6666);

            proxy.Start();
            Console.ReadKey();
        }
Example #4
0
        static void Main(string[] args)
        {
            const int PORT = 10100;

            Proxy proxy = new Proxy(PORT);

            proxy.Start();

            Console.ReadKey();
        }
Example #5
0
        static void Main(string[] args)
        {
            Proxy worker = new Proxy();

            worker.Start();
        }