using System; using System.Collections.Generic; using System.Linq.Expressions; using Machine.Specifications; using MonoStockPortfolio.Activites.EditPositionScreen; using MonoStockPortfolio.Core.PortfolioRepositories; using MonoStockPortfolio.Core.StockData; using Telerik.JustMock; namespace MonoStockPortfolio.Tests.Presenters.EditPosition { public class EditPositionTests { protected static EditPositionPresenter _presenter; protected static IPortfolioRepository _mockPortfolioRepository; protected static IStockDataProvider _mockStockService; protected static IEditPositionView _mockView; Establish context = () => { _mockPortfolioRepository = Mock.Create(); _mockStockService = Mock.Create(); _mockView = Mock.Create(); _presenter = new EditPositionPresenter(_mockPortfolioRepository, _mockStockService); }; protected static void MockPositionMatches(Expression>> match) { Mock.Assert(() => _mockView.ShowErrorMessages(Arg.Matches(match)), Occurs.Exactly(1)); } } }