Пример #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");
        }
Пример #4
0
 public IActionResult GetStock([FromServices] GetStocks getStocks) =>
 Ok(getStocks.Do());
Пример #5
0
 public async Task <IActionResult> GetStocks([FromServices] GetStocks getStocks) => Ok(await getStocks.Do());
 public IActionResult GetProducts([FromServices] GetStocks getProducts) =>
 Ok(getProducts.Do());