Exemplo n.º 1
0
 public void SymbolExistsWorksAsExpected()
 {
     using (var marketFeed = new MarketFeedService(new MockPriceUpdatedEventAggregator()))
     {
         Assert.IsTrue(marketFeed.SymbolExists("STOCK0"));
         Assert.IsFalse(marketFeed.SymbolExists("NONEXISTANT"));
     }
 }
Exemplo n.º 2
0
 public void GetPriceOfNonExistingSymbolThrows()
 {
     using (var marketFeed = new MarketFeedService(new MockPriceUpdatedEventAggregator()))
     {
         try
         {
             marketFeed.GetPrice("NONEXISTANT");
             Assert.Fail("No exception thrown");
         }
         catch (Exception ex)
         {
             Assert.IsInstanceOfType(ex, typeof(ArgumentException));
             Assert.IsTrue(ex.Message.Contains("Symbol does not exist in market feed."));
         }
     }
 }
Exemplo n.º 3
0
 public void SingleFeedSourceExpertAdvisor_Works()
 {
     var marketFeed    = new MarketFeedService();
     var marketOrder   = new MarketOrderService();
     var expertAdvisor = new ExpertAdvisor(marketFeed, marketOrder);
 }