Example #1
0
        private ProjectRootImageProjectTreePropertiesProvider CreateInstance(IProjectCapabilitiesService capabilities, IProjectImageProvider imageProvider)
        {
            capabilities  = capabilities ?? IProjectCapabilitiesServiceFactory.Create();
            imageProvider = imageProvider ?? IProjectImageProviderFactory.Create();

            return(new ProjectRootImageProjectTreePropertiesProvider(capabilities, imageProvider));
        }
        public void Constructor_NullAsImageProvider_ThrowsArgumentNull()
        {
            var capabilities = IProjectCapabilitiesServiceFactory.Create();

            Assert.Throws <ArgumentNullException>("imageProvider", () => {
                new ProjectRootImageProjectTreePropertiesProvider(capabilities, (IProjectImageProvider)null);
            });
        }
        public void CalculatePropertyValues_WhenSharedItemsImportFileAsTree_SetsIconToSharedItemsImportFile(string input, string expected)
        {
            var capabilities = IProjectCapabilitiesServiceFactory.ImplementsContains(capability => {
                return(capability == ProjectCapabilities.SharedAssetsProject);
            });

            var imageProvider = IProjectImageProviderFactory.ImplementGetProjectImage(ProjectImageKey.SharedItemsImportFile, new ProjectImageMoniker(new Guid("{A140CD9F-FF94-483C-87B1-9EF5BE9F469A}"), 1));

            var propertiesProvider = CreateInstance(capabilities, imageProvider);

            var inputTree    = ProjectTreeParser.Parse(input);
            var expectedTree = ProjectTreeParser.Parse(expected);
            var result       = propertiesProvider.ChangePropertyValuesForEntireTree(inputTree);

            AssertAreEquivalent(expectedTree, result);
        }