mirror of
https://github.com/mgroves/MonodroidStockPortfolio.git
synced 2025-01-06 03:00:18 +00:00
32 lines
No EOL
1 KiB
C#
32 lines
No EOL
1 KiB
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Machine.Specifications;
|
|
using Machine.Specifications.Runner.Impl;
|
|
using MonoStockPortfolio.Core.StockData;
|
|
using MonoStockPortfolio.Entities;
|
|
|
|
namespace MonoStockPortfolio.Tests.Services
|
|
{
|
|
[Tags("IntegrationTest")]
|
|
public class When_using_the_Yahoo_stock_data_service_to_get_quotes
|
|
{
|
|
static YahooStockDataProvider _svc;
|
|
static IList<StockQuote> _quotes;
|
|
|
|
Establish context = () =>
|
|
{
|
|
_svc = new YahooStockDataProvider();
|
|
};
|
|
|
|
Because of = () =>
|
|
{
|
|
_quotes = _svc.GetStockQuotes(new[] { "GOOG", "AMZN", "AAPL", "MSFT", "S", "VZ", "T" })
|
|
.ToList();
|
|
};
|
|
|
|
It should_get_volumes_from_the_web = () =>
|
|
_quotes.ForEach(q => string.IsNullOrEmpty(q.Volume).ShouldBeFalse());
|
|
It should_get_last_trade_prices_from_the_web = () =>
|
|
_quotes.ForEach(q => q.LastTradePrice.ShouldNotEqual(0.0M));
|
|
}
|
|
} |