Esempio n. 1
0
        public void AssemblyDependencyNode_Constructor_Resolved(
            string fusionName)
        {
            // Arrange
            var priority = DependencyNode.FrameworkAssemblyNodePriority;
            var id       = DependencyNodeId.FromString(
                "file:///[MyProviderType;c:\\MyItemSpec.dll;MyItemType;MyUniqueToken]");
            var properties = new Dictionary <string, string>().ToImmutableDictionary();

            // Act
            var node = new AssemblyDependencyNode(id,
                                                  ProjectTreeFlags.Empty,
                                                  priority,
                                                  properties,
                                                  resolved: false,
                                                  fusionName: fusionName);

            // Assert
            Assert.Equal(KnownMonikers.ReferenceWarning, node.Icon);
            Assert.Equal(false, node.Resolved);
            Assert.Equal("MyItemSpec.dll", node.Caption);

            // Just to double-check that these properties are still set as sexpected
            Assert.Equal(priority, node.Priority);
            Assert.Equal(properties, node.Properties);
            Assert.Equal(node.Icon, node.ExpandedIcon);
        }
Esempio n. 2
0
        public void AssemblyDependencyNode_Constructor_ResolvedUnresolved(
            string fusionName,
            string expectedCaption)
        {
            // Arrange
            var priority = DependencyNode.FrameworkAssemblyNodePriority;
            var id       = DependencyNodeId.FromString(
                "file:///[MyProviderType;c:\\MyItemSpec.dll;MyItemType;MyUniqueToken]");
            var properties   = new Dictionary <string, string>().ToImmutableDictionary();
            var defaultFlags = DependencyNode.GenericResolvedDependencyFlags;
            var myFlags      = ProjectTreeFlags.Create("MyFlag");

            // Act
            var node = new AssemblyDependencyNode(id,
                                                  myFlags,
                                                  priority,
                                                  properties,
                                                  resolved: true,
                                                  fusionName: fusionName);

            // Assert
            Assert.Equal(KnownMonikers.Reference, node.Icon);
            Assert.Equal(true, node.Resolved);
            Assert.Equal(expectedCaption, node.Caption);
            Assert.Equal(expectedCaption, node.Name);

            // Just to double-check that these properties are still set as sexpected
            Assert.Equal(priority, node.Priority);
            Assert.Equal(properties, node.Properties);
            Assert.Equal(node.Icon, node.ExpandedIcon);
            Assert.True(node.Flags.Contains(defaultFlags.Union(myFlags)));
        }