protected override void Context()
 {
     _multiEditPresenter            = A.Fake <IMultiParameterEditPresenter>();
     _parameterGroupPresenterMapper = A.Fake <IParameterGroupToCustomableParametersPresenter>();
     _containerPresentrMapper       = A.Fake <IContainerToCustomableParametersPresenterMapper>();
     _multiEditPresenterFactory     = A.Fake <IMultiParameterEditPresenterFactory>();
     A.CallTo(() => _multiEditPresenterFactory.Create()).Returns(_multiEditPresenter);
     sut = new NodeToCustomableParametersPresenterMapper(_containerPresentrMapper, _parameterGroupPresenterMapper, _multiEditPresenterFactory);
 }
Beispiel #2
0
        public ICustomParametersPresenter MapFrom(ITreeNode node)
        {
            var parameterGroupNode = node as ITreeNode <IGroup>;

            if (parameterGroupNode != null)
            {
                return(_parameterGroupPresenterMapper.MapFrom(parameterGroupNode.Tag));
            }

            var containerNode = node as ITreeNode <IContainer>;

            if (containerNode != null)
            {
                return(_containerPresenterMapper.MapFrom(containerNode.Tag));
            }

            return(_multiParameterEditPresenterFactory.Create());
        }