예제 #1
0
        public void GetStockTest_VenueExists()
        {
            GetStocks      request = new GetStocks("TESTEX");
            bool           actual  = request.Execute();
            GetStocksReply reply   = request.Reply as GetStocksReply;

            Assert.IsTrue(actual);
            Assert.IsNotNull(reply);
            Assert.IsTrue(string.IsNullOrWhiteSpace(reply.Error));
        }
예제 #2
0
        public GetStocksReply GetStocks()
        {
            GetStocks      request = new GetStocks(Name);
            bool           success = request.Execute();
            GetStocksReply reply   = (request.Reply as GetStocksReply) ?? new GetStocksReply(false);

            if (success)
            {
                UpdateStocks(reply);
            }
            return(reply);
        }
예제 #3
0
        public void GetStockTest_DoesNotExist()
        {
            GetStocks      request = new GetStocks("FALSEEX");
            bool           actual  = request.Execute();
            GetStocksReply reply   = request.Reply as GetStocksReply;

            Assert.IsFalse(actual);
            Assert.IsNull(reply);
            BaseReply baseReply = request.Reply as BaseReply;

            Assert.IsNotNull(baseReply);
            StringAssert.Contains(baseReply.Error, "The remote server returned an error: (404) Not Found");
        }