Exemple #1
0
        protected override void Context()
        {
            base.Context();
            _container = new Container();
            var childContainer1      = new Container().WithId("childContainer1").WithName("childContainer1");
            var childChildContainer1 = new Container().WithId("childChildContainer1").WithName("childChildContainer1");

            childChildContainer1.Add(new Parameter().WithId("parameterInChildChildContainer1").WithName("parameterInChildChildContainer1"));
            var childContainer2 = new Container().WithId("childContainer2").WithName("childContainer2");

            childContainer2.Add(new Parameter().WithId("parameterInchildContainer2").WithName("parameterInchildContainer2"));
            var childContainer3      = new Container().WithId("_childContainer3").WithName("_childContainer3");
            var distrubutedParameter = new DistributedParameter().WithId("DistributedParameter").WithName("DistributedParameter");

            childContainer1.Add(childChildContainer1);
            _container.Add(childContainer1);
            _container.Add(childContainer2);
            _container.Add(childContainer3);
            childChildContainer1.Add(distrubutedParameter);
            _availableInfo = new RepresentationInfo {
                DisplayName = "tralal", IconName = "Stop"
            };
            A.CallTo(() => _representationInfoRepository.InfoFor(_container)).Returns(_availableInfo);
            A.CallTo(() => _representationInfoRepository.InfoFor(childChildContainer1)).Returns(new RepresentationInfo());
            A.CallTo(() => _representationInfoRepository.InfoFor(childContainer2)).Returns(new RepresentationInfo());
            A.CallTo(() => _representationInfoRepository.InfoFor(childContainer1)).Returns(new RepresentationInfo());
            A.CallTo(() => _representationInfoRepository.InfoFor(childContainer3)).Returns(new RepresentationInfo());
            A.CallTo(() => _representationInfoRepository.InfoFor(distrubutedParameter)).Returns(new RepresentationInfo());
        }
Exemple #2
0
        protected override void Context()
        {
            base.Context();

            _formulaType     = FormulaType.Rate;
            _parentContainer = new Container();
            _parentContainer.Add(_parameter);
            _parameter.Name = "_parameter";
            A.CallTo(() => _formulaTypeMapper.MapFrom(_parameter.Formula)).Returns(_formulaType);
            _repInfoParameter = new RepresentationInfo {
                DisplayName = "display para", Description = "desc para"
            };
            _path0 = new RepresentationInfo {
                DisplayName = "Organism"
            };
            _path1 = new RepresentationInfo {
                DisplayName = "Organ"
            };
            _path2 = _repInfoParameter;
            A.CallTo(() => _representationInfoRepository.InfoFor(_parameter)).Returns(_repInfoParameter);
            var cache = new PathElements();

            cache.Add(PathElementId.TopContainer, new PathElement {
                DisplayName = _path0.DisplayName
            });
            cache.Add(PathElementId.Container, new PathElement {
                DisplayName = _path1.DisplayName
            });
            A.CallTo(() => _pathToPathElementsMapper.MapFrom(_parameter)).Returns(cache);
            var parameterPath = new ObjectPath();

            A.CallTo(() => _entityPathResolver.ObjectPathFor(_parameter, false)).Returns(parameterPath);
            A.CallTo(() => _favoriteRepository.Contains(parameterPath)).Returns(true);
        }
        public ITreeNode <TObjectBase> CreateFor <TObjectBase>(TObjectBase entity, RepresentationInfo representationInfo) where TObjectBase : class, IObjectBase
        {
            var node = CreateObjectBaseNode(entity);

            node.Text    = representationInfo.DisplayName;
            node.ToolTip = _toolTipPartCreator.ToolTipFor(representationInfo.Description);
            node.Icon    = ApplicationIcons.IconByName(representationInfo.IconName);
            return(node);
        }
 public static PathElementDTO ToPathElement(this RepresentationInfo representationInfo)
 {
     return(new PathElementDTO
     {
         Description = representationInfo.DisplayName,
         IconName = representationInfo.IconName,
         DisplayName = representationInfo.DisplayName,
     });
 }
        private void addParameterNode(ITreeNode node, IParameter parameter, PathElement pathElementDTO)
        {
            var representation = new RepresentationInfo {
                DisplayName = pathElementDTO.DisplayName, IconName = pathElementDTO.IconName
            };
            var parameterNode = _treeNodeFactory.CreateFor(parameter, representation);

            parameterNode.ToolTip = _toolTipPartCreator.ToolTipFor(_fullPathDisplayResolver.FullPathFor(parameter));
            node.AddChild(parameterNode);
        }
        public static void UpdatePathElement(this RepresentationInfo representationInfo, PathElementDTO pathElementDTO)
        {
            pathElementDTO.Description = representationInfo.Description;
            pathElementDTO.DisplayName = representationInfo.DisplayName;

            if (!string.IsNullOrEmpty(representationInfo.IconName))
            {
                pathElementDTO.IconName = representationInfo.IconName;
            }
        }
 protected override void Context()
 {
     base.Context();
     _pvv             = new ParameterValueVersion();
     _categoryRepInfo = new RepresentationInfo {
         Description = "CatDesc", DisplayName = "CatDisplay"
     };
     _pvv.Category = "tralala";
     A.CallTo(() => _representationInfoRepository.InfoFor(RepresentationObjectType.CATEGORY, _pvv.Category)).Returns(_categoryRepInfo);
 }
Exemple #8
0
 protected override void Context()
 {
     base.Context();
     _formulation = new Formulation();
     _formulation.FormulationType = "tralala";
     _formulationInfo             = new RepresentationInfo();
     _para1 = A.Fake <IParameter>().WithName("Para1");
     _para2 = A.Fake <IParameter>().WithName("Para2");
     _formulation.Add(_para1);
     _formulation.Add(_para2);
     _formulationInfo.Description = " traaa";
     _formulationInfo.DisplayName = "tutu";
     A.CallTo(() => _representationInfoRepository.InfoFor(RepresentationObjectType.CONTAINER, _formulation.FormulationType)).Returns(_formulationInfo);
 }