protected override void Context() { _view = A.Fake <IXAndYNumericFieldsView>(); _eventPublisher = A.Fake <IEventPublisher>(); sut = new XAndYNumericFieldsPresenter(_view, _eventPublisher); //common context for all tests A.CallTo(() => _view.BindTo(A <XandYFieldsSelectionDTO> ._)) .Invokes(x => _dto = x.GetArgument <XandYFieldsSelectionDTO>(0)); _field1 = A.Fake <PopulationAnalysisNumericField>(); _field2 = A.Fake <PopulationAnalysisNumericField>(); _field3 = A.Fake <PopulationAnalysisNumericField>(); _populationDataCollector = A.Fake <IPopulationDataCollector>(); _populationAnalysis = A.Fake <PopulationPivotAnalysis>(); _allDataFields = new List <IPopulationAnalysisField>(); _allNumericFields = new List <IPopulationAnalysisField>(); A.CallTo(() => _populationAnalysis.AllFieldsOn(PivotArea.DataArea)).Returns(_allDataFields); A.CallTo(() => _populationAnalysis.All(typeof(INumericValueField), false)).Returns(_allNumericFields); sut.StartAnalysis(_populationDataCollector, _populationAnalysis); }
public XAndYNumericFieldsPresenter(IXAndYNumericFieldsView view, IEventPublisher eventPublisher) : base(view) { _eventPublisher = eventPublisher; _allowedType = typeof(INumericValueField); _nullField = new NullNumericField(); _selectionDTO = new XandYFieldsSelectionDTO { X = _nullField, Y = _nullField }; _allAvailableFields = new List <IPopulationAnalysisField>(); }
public void BindTo(XandYFieldsSelectionDTO fieldsSelectionDTO) { _screenBinder.BindToSource(fieldsSelectionDTO); }