/// <summary> /// Initializes the singleton application object. This is the first line of authored code /// executed, and as such is the logical equivalent of main() or WinMain(). /// </summary> public App() { Quotes = new ObservableCollection <GreatQuote>(quoteLoader.Load()); this.InitializeComponent(); this.Suspending += OnSuspending; }
public async Task Should_skip_invalid_symbols() { var symbols = new[] { new Symbol("MSFT"), new Symbol("XXX") }; Quote[] quotes = (await QuoteLoader.Load(symbols)).ToArray(); quotes.Should().HaveCount(1); quotes.First().Symbol.Should().Be(new Symbol("MSFT")); quotes.First().Price.Should().BeGreaterThan(0); }
public async Task Should_load_quotes() { var symbols = new[] { new Symbol("MSFT"), new Symbol("AAPL") }; Quote[] quotes = (await QuoteLoader.Load(symbols)).ToArray(); quotes.Should().HaveCount(2); quotes.First().Symbol.Should().Be(new Symbol("MSFT")); quotes.First().Price.Should().BeGreaterThan(0); quotes.Skip(1).First().Symbol.Should().Be(new Symbol("AAPL")); quotes.Skip(1).First().Price.Should().BeGreaterThan(0); }