2011-04-08 02:57:38 +00:00
|
|
|
using System;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using System.Linq.Expressions;
|
2011-03-20 03:21:12 +00:00
|
|
|
using Machine.Specifications;
|
|
|
|
using MonoStockPortfolio.Activites.EditPositionScreen;
|
|
|
|
using MonoStockPortfolio.Core.PortfolioRepositories;
|
|
|
|
using MonoStockPortfolio.Core.StockData;
|
|
|
|
using Telerik.JustMock;
|
|
|
|
|
2011-04-02 04:19:55 +00:00
|
|
|
namespace MonoStockPortfolio.Tests.Presenters.EditPosition
|
2011-03-20 03:21:12 +00:00
|
|
|
{
|
|
|
|
public class EditPositionTests
|
|
|
|
{
|
|
|
|
protected static EditPositionPresenter _presenter;
|
|
|
|
protected static IPortfolioRepository _mockPortfolioRepository;
|
|
|
|
protected static IStockDataProvider _mockStockService;
|
|
|
|
protected static IEditPositionView _mockView;
|
|
|
|
|
|
|
|
Establish context = () =>
|
|
|
|
{
|
|
|
|
_mockPortfolioRepository = Mock.Create<IPortfolioRepository>();
|
|
|
|
_mockStockService = Mock.Create<IStockDataProvider>();
|
|
|
|
_mockView = Mock.Create<IEditPositionView>();
|
|
|
|
|
|
|
|
_presenter = new EditPositionPresenter(_mockPortfolioRepository, _mockStockService);
|
|
|
|
};
|
|
|
|
|
2011-04-08 02:57:38 +00:00
|
|
|
protected static void MockPositionMatches(Expression<Predicate<IList<string>>> match)
|
|
|
|
{
|
|
|
|
Mock.Assert(() => _mockView.ShowErrorMessages(Arg.Matches(match)), Occurs.Exactly(1));
|
|
|
|
}
|
2011-03-20 03:21:12 +00:00
|
|
|
}
|
|
|
|
}
|