public void TestStartMonitoring_ReceivesPriceNotifications() { //Arrange myTestee.Start(); //Act myTestee.StartMonitoring(new List <string>() { "a" }); System.Threading.Thread.Sleep(myUpdateInterval * 3); //Assert Assert.NotNull(myReceivedInstrumentPrices); Assert.IsTrue(myReceivedInstrumentPrices.ToList().ToDictionary(x => x.Key, x => x.Value).ContainsKey("a")); Assert.AreEqual(1, myReceivedInstrumentPrices.ToList().Count); //Should contain only one item }
private void AddItem() { if (!CurrentInstrumentItems.Any(item => item.Symbol == ItemToAdd.ToUpper())) { ErrorText = ""; try { myPricingEngine.StartMonitoring(new List <string>() { ItemToAdd.ToUpper() }); } catch (InvalidDataException ex) { ErrorText = ex.Message; } } else { ErrorText = string.Format(" {0} already in the list!", ItemToAdd); } }