protected override void Context() { _speciesRepository = A.Fake <ISpeciesRepository>(); _view = A.Fake <IIndividualSettingsView>(); _defaultValueRetriever = A.Fake <IIndividualDefaultValueRetriever>(); _individualSettingsDTOMapper = A.Fake <IIndividualToIIndividualSettingsDTOMapper>(); _individualMapper = A.Fake <IIndividualSettingsDTOToIndividualMapper>(); _calculationMethodRepository = A.Fake <ICalculationMethodCategoryRepository>(); _subPopulation = A.Fake <IEnumerable <CategoryParameterValueVersionDTO> >(); _editValueOriginPresenter = A.Fake <IEditValueOriginPresenter>(); _individualSettingsDTO = new IndividualSettingsDTO(); _individualPropertiesDTO = new ObjectBaseDTO(); _speciesPopulation = A.Fake <SpeciesPopulation>(); _species = A.Fake <Species>(); _gender = A.Fake <Gender>(); _cmCat1 = new CalculationMethodCategory(); _cmCat2 = new CalculationMethodCategory(); _cmCat1.Add(new CalculationMethod()); _cmCat2.Add(new CalculationMethod()); _individualSettingsDTO.Species = _species; _individualSettingsDTO.SpeciesPopulation = _speciesPopulation; _individualSettingsDTO.Gender = _gender; A.CallTo(() => _defaultValueRetriever.DefaultSettings()).Returns(_individualSettingsDTO); A.CallTo(() => _calculationMethodRepository.All()).Returns(new[] { _cmCat1, _cmCat2 }); _individualSettingsDTO.SubPopulation = _subPopulation; _parentPresenter = A.Fake <IIndividualPresenter>(); sut = new IndividualSettingsPresenter(_view, _speciesRepository, _calculationMethodRepository, _defaultValueRetriever, _individualSettingsDTOMapper, _individualMapper, _editValueOriginPresenter); sut.InitializeWith(_parentPresenter); }
public IndividualSettingsPresenter(IIndividualSettingsView view, ISpeciesRepository speciesRepository, ICalculationMethodCategoryRepository calculationMethodCategoryRepository, IIndividualDefaultValueRetriever defaultValueRetriever, IIndividualToIIndividualSettingsDTOMapper individualSettingsDTOMapper, IIndividualSettingsDTOToIndividualMapper individualMapper) : base(view) { _speciesRepository = speciesRepository; _calculationMethodCategoryRepository = calculationMethodCategoryRepository; _defaultValueRetriever = defaultValueRetriever; _individualSettingsDTOMapper = individualSettingsDTOMapper; _individualMapper = individualMapper; }
public IndividualSettingsPresenter( IIndividualSettingsView view, ISpeciesRepository speciesRepository, ICalculationMethodCategoryRepository calculationMethodCategoryRepository, IIndividualDefaultValueRetriever defaultValueRetriever, IIndividualToIIndividualSettingsDTOMapper individualSettingsDTOMapper, IIndividualSettingsDTOToIndividualMapper individualMapper, IEditValueOriginPresenter editValueOriginPresenter) : base(view) { _speciesRepository = speciesRepository; _calculationMethodCategoryRepository = calculationMethodCategoryRepository; _defaultValueRetriever = defaultValueRetriever; _individualSettingsDTOMapper = individualSettingsDTOMapper; _individualMapper = individualMapper; _editValueOriginPresenter = editValueOriginPresenter; _editValueOriginPresenter.ShowCaption = false; AddSubPresenters(_editValueOriginPresenter); _view.AddValueOriginView(_editValueOriginPresenter.View); _editValueOriginPresenter.ValueOriginUpdated = valueOriginUpdated; }