Exemplo n.º 1
0
        public void GetPropertyInfoProp()
        {
            // Regression test for (internal). Use a decorated factory since
            // propertyInfo.pProperty should be the decorated object.
            var decoratorUtil = new DecoratorUtil(
                new ProxyGenerationOptions(new DebugEngineProxyHook()));

            // Needs at least one aspect or else decorator is not assigned to Self.
            IDecorator factoryDecorator = decoratorUtil.CreateFactoryDecorator(
                new ProxyGenerator(), new NoopAspect());

            DebugAsyncProperty.Factory decoratedPropertyFactory =
                factoryDecorator.Decorate(propertyFactory);

            IGgpAsyncDebugProperty decoratedDebugProperty =
                decoratedPropertyFactory.Create(mockVarInfo);

            DEBUG_PROPERTY_INFO propertyInfo;

            decoratedDebugProperty.GetPropertyInfo(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP,
                                                   out propertyInfo);

            Assert.That(
                propertyInfo.dwFields.HasFlag(enum_DEBUGPROP_INFO_FLAGS.DEBUGPROP_INFO_PROP));

            Assert.That(propertyInfo.pProperty, Is.SameAs(decoratedDebugProperty));
        }
Exemplo n.º 2
0
        public void SetUp()
        {
            mockVarInfo            = Substitute.For <IVariableInformation>();
            mockCodeContextFactory = Substitute.For <DebugCodeContext.Factory>();

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

            var childrenProviderFactory = new ChildrenProvider.Factory();
            var debugPropertyFactory    = new DebugAsyncProperty.Factory(
                enumFactory, childrenProviderFactory, mockCodeContextFactory,
                new VsExpressionCreator(), taskExecutor);

            createPropertyDelegate = debugPropertyFactory.Create;

            childrenProviderFactory.Initialize(createPropertyDelegate);

            logSpy = new LogSpy();
            logSpy.Attach();
        }