Пример #1
0
 public void FactoryThrowsIfCreatePropertyDelegateIsNull()
 {
     _childrenProviderFactory.Initialize(null);
     Assert.Throws <NullReferenceException>(() => _childrenProviderFactory.Create(
                                                new ListChildAdapter.Factory().Create(
                                                    _children), _nameFlag, 0));
 }
Пример #2
0
        public void SetUp()
        {
            FillThreeChildren();

            _childrenProviderFactory = new ChildrenProvider.Factory();

            var taskExecutor    = new TaskExecutor(new JoinableTaskContext().Factory);
            var enumFactory     = new VariableInformationEnum.Factory(taskExecutor);
            var propertyFactory = new DebugProperty.Factory(
                enumFactory, _childrenProviderFactory, Substitute.For <DebugCodeContext.Factory>(),
                new VsExpressionCreator(), taskExecutor);

            _childrenProviderFactory.Initialize(propertyFactory.Create);

            _childrenProvider =
                _childrenProviderFactory.Create(new ListChildAdapter.Factory().Create(_children),
                                                _nameFlag, 0);
        }
Пример #3
0
        public void SetUp()
        {
            _children = new List <IVariableInformation>();

            var child1 = Substitute.For <IVariableInformation>();

            child1.DisplayName.Returns("child1");
            child1.GetCachedView().Returns(child1);
            _children.Add(child1);

            var child2 = Substitute.For <IVariableInformation>();

            child2.DisplayName.Returns("child2");
            child2.GetCachedView().Returns(child2);
            _children.Add(child2);

            var child3 = Substitute.For <IVariableInformation>();

            child3.DisplayName.Returns("child3");
            child3.GetCachedView().Returns(child3);
            _children.Add(child3);

            var taskExecutor = new TaskExecutor(new JoinableTaskContext().Factory);

            _enumFactory = new VariableInformationEnum.Factory(taskExecutor);

            _childrenProviderFactory = new ChildrenProvider.Factory();
            var propertyFactory = new DebugProperty.Factory(
                _enumFactory, _childrenProviderFactory, Substitute.For <DebugCodeContext.Factory>(),
                new VsExpressionCreator(), taskExecutor);

            _childrenProviderFactory.Initialize(propertyFactory.Create);

            var childrenProvider = _childrenProviderFactory.Create(
                new ListChildAdapter.Factory().Create(_children),
                enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_NAME, 0);

            _varInfoEnum = _enumFactory.Create(childrenProvider);
        }