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)); }
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); }
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"); }