Ejemplo n.º 1
0
        public void Implicit()
        {
            var properties = ImmutableStringDictionary <string> .EmptyOrdinal.Add("myProp", "myVal");

            var model = new AnalyzerDependencyModel(
                "c:\\myPath",
                "myOriginalItemSpec",
                resolved: true,
                isImplicit: true,
                properties: properties);

            Assert.Equal(AnalyzerRuleHandler.ProviderTypeString, model.ProviderType);
            Assert.Equal("c:\\myPath", model.Path);
            Assert.Equal("myOriginalItemSpec", model.OriginalItemSpec);
            Assert.Equal("myPath", model.Caption);
            Assert.Equal(ResolvedAnalyzerReference.SchemaName, model.SchemaName);
            Assert.True(model.Resolved);
            Assert.True(model.Implicit);
            Assert.Equal(properties, model.Properties);
            Assert.Equal(Dependency.AnalyzerNodePriority, model.Priority);
            Assert.Equal(AnalyzerReference.PrimaryDataSourceItemType, model.SchemaItemType);
            Assert.Equal(ManagedImageMonikers.CodeInformationPrivate, model.Icon);
            Assert.Equal(ManagedImageMonikers.CodeInformationPrivate, model.ExpandedIcon);
            Assert.Equal(ManagedImageMonikers.CodeInformationWarning, model.UnresolvedIcon);
            Assert.Equal(ManagedImageMonikers.CodeInformationWarning, model.UnresolvedExpandedIcon);
            Assert.Equal(
                DependencyTreeFlags.AnalyzerSubTreeNodeFlags +
                DependencyTreeFlags.GenericResolvedDependencyFlags -
                DependencyTreeFlags.SupportsRemove,
                model.Flags);
        }
Ejemplo n.º 2
0
        public void Implicit()
        {
            var properties = ImmutableDictionary <string, string> .Empty.Add("myProp", "myVal");

            var flag  = ProjectTreeFlags.Create("MyCustomFlag");
            var model = new AnalyzerDependencyModel(
                "myProvider",
                "c:\\myPath",
                "myOriginalItemSpec",
                flags: flag,
                resolved: true,
                isImplicit: true,
                properties: properties);

            Assert.Equal("myProvider", model.ProviderType);
            Assert.Equal("c:\\myPath", model.Path);
            Assert.Equal("myOriginalItemSpec", model.OriginalItemSpec);
            Assert.Equal("myPath", model.Caption);
            Assert.Equal(ResolvedAnalyzerReference.SchemaName, model.SchemaName);
            Assert.Equal(true, model.Resolved);
            Assert.Equal(true, model.Implicit);
            Assert.Equal(properties, model.Properties);
            Assert.Equal(Dependency.AnalyzerNodePriority, model.Priority);
            Assert.Equal(AnalyzerReference.PrimaryDataSourceItemType, model.SchemaItemType);
            Assert.Equal(ManagedImageMonikers.CodeInformationPrivate, model.Icon);
            Assert.Equal(ManagedImageMonikers.CodeInformationPrivate, model.ExpandedIcon);
            Assert.Equal(ManagedImageMonikers.CodeInformationWarning, model.UnresolvedIcon);
            Assert.Equal(ManagedImageMonikers.CodeInformationWarning, model.UnresolvedExpandedIcon);
            Assert.True(model.Flags.Contains(flag));
        }
        public void Unresolved()
        {
            var properties = ImmutableStringDictionary <string> .EmptyOrdinal.Add("myProp", "myVal");

            var model = new AnalyzerDependencyModel(
                "c:\\myPath",
                "myOriginalItemSpec",
                resolved: false,
                isImplicit: false,
                properties: properties);

            Assert.Equal(AnalyzerRuleHandler.ProviderTypeString, model.ProviderType);
            Assert.Equal("c:\\myPath", model.Path);
            Assert.Equal("myOriginalItemSpec", model.OriginalItemSpec);
            Assert.Equal("c:\\myPath", model.Caption);
            Assert.Equal(AnalyzerReference.SchemaName, model.SchemaName);
            Assert.False(model.Resolved);
            Assert.False(model.Implicit);
            Assert.Equal(properties, model.Properties);
            Assert.Equal(GraphNodePriority.Analyzer, model.Priority);
            Assert.Equal(AnalyzerReference.PrimaryDataSourceItemType, model.SchemaItemType);
            Assert.Equal(KnownMonikers.CodeInformation, model.Icon);
            Assert.Equal(KnownMonikers.CodeInformation, model.ExpandedIcon);
            Assert.Equal(ManagedImageMonikers.CodeInformationWarning, model.UnresolvedIcon);
            Assert.Equal(ManagedImageMonikers.CodeInformationWarning, model.UnresolvedExpandedIcon);
            Assert.Equal(
                DependencyTreeFlags.AnalyzerDependency +
                DependencyTreeFlags.GenericUnresolvedDependencyFlags,
                model.Flags);
        }