Exemple #1
0
 public BuildingBlockMergePresenter(IBuildingBlockMergeView view, IDialogCreator dialogCreator,
                                    IMergeTask mergeTask, IBuildingBlockRepository buildingBlockRepository,
                                    IIconRepository iconRepository, ISerializationTask serializationTask) : base(view)
 {
     _cancellationTokenSource = new CancellationTokenSource();
     _dialogCreator           = dialogCreator;
     _mergeTask = mergeTask;
     _buildingBlockRepository  = buildingBlockRepository;
     _allBuildingBlockMappings = new List <BuildingBlockMappingDTO>();
     _noneBuildingBlock        = new NullBuildingBlock(AppConstants.None);
     _importAsNewBuildingBlock = new NullBuildingBlock(AppConstants.Captions.ImportAsNew);
     _iconRepository           = iconRepository;
     _serializationTask        = serializationTask;
 }
        protected override void Context()
        {
            _serializationTask      = A.Fake <ISerializationTask>();
            _dialogCreator          = A.Fake <IDialogCreator>();
            _buildingBlockMergeView = A.Fake <IBuildingBlockMergeView>();
            _mergeTask = A.Fake <IMergeTask>();
            sut        = new BuildingBlockMergePresenter <IBuildingBlock>(_buildingBlockMergeView, _dialogCreator, _mergeTask, A.Fake <IBuildingBlockRepository>(), A.Fake <IIconRepository>(), _serializationTask);
            sut.InitializeWith(A.Fake <ICommandCollector>());
            _targetObject = A.Fake <IBuildingBlock>();
            _mergeObject  = A.Fake <IBuildingBlock>();

            A.CallTo(() => _targetObject.Name).Returns("target");
            A.CallTo(() => _mergeObject.Name).Returns("merge");

            A.CallTo(() => _serializationTask.Load <IBuildingBlock>(A <string> ._, A <bool> ._)).Returns(_mergeObject);
        }