Exemplo n.º 1
0
        // TODO Blocking Time default
        public void requestStrategy(IGoedleDownloadBuffer goedleDownloadBuffer)
        {
            GoedleUtils gu  = new GoedleUtils();
            string      url = gu.getStrategyUrl(_app_key);

            _gio_http_client.requestStrategy(url, this, _gwr, goedleDownloadBuffer, _staging);
        }
        public IEnumerator checkBehaviorGoedleWebRequest()
        {
            _gdb.text.Returns(_strategy_string);
            _gw.isHttpError.Returns(false);
            _gw.isNetworkError.Returns(false);
            _gio_http_client.requestStrategy(_url, _gio_object, _gw, _gdb, _staging);

            int c = 0;

            while (_gio_object.strategy == null || c < 120)
            {
                yield return(null);

                c++;
            }

            _gw.Received(2).SendWebRequest();

            Assert.AreEqual(_gio_object.strategy["config"]["scenario"].Value, "seashore");
            Assert.AreEqual(_gio_object.strategy["config"]["wind_speed"].Value, "fast");
            Assert.AreEqual(_gio_object.strategy["id"].Value, "1");
        }