public void GetOrderbookTest_Default() { GetOrderbook request = new GetOrderbook(); bool actual = request.Execute(); Assert.IsTrue(actual); GetOrderbookReply reply = request.Reply as GetOrderbookReply; Assert.IsNotNull(reply); }
public void GetOrderbookTest_VenueAndStockExists() { Stock stock = new Stock("", "FOOBAR"); GetOrderbook request = new GetOrderbook("TESTEX", stock); bool actual = request.Execute(); Assert.IsTrue(actual); GetOrderbookReply reply = request.Reply as GetOrderbookReply; Assert.IsNotNull(reply); }
public GetOrderbookReply GetOrderbook(Stock stock) { GetOrderbook request = new GetOrderbook(Name, stock); bool success = request.Execute(); GetOrderbookReply reply = (request.Reply as GetOrderbookReply) ?? new GetOrderbookReply(false); if (success) { UpdateOrderbook(reply); } return(reply); }
public void GetOrderbookTest_VenueAndStockDoesNotExists() { Stock stock = new Stock("", "FALSE"); GetOrderbook request = new GetOrderbook("FALSEEX", stock); bool actual = request.Execute(); Assert.IsFalse(actual); GetOrderbookReply reply = request.Reply as GetOrderbookReply; 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."); }