// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information using System; using System.Collections.Generic; using System.Collections.Immutable; using Microsoft.VisualStudio.ProjectSystem.Properties; namespace Microsoft.VisualStudio.ProjectSystem { internal class TestProjectRuleSnapshot : IProjectRuleSnapshot { public static TestProjectRuleSnapshot CreateProperties(string ruleName, Dictionary properties) { return new TestProjectRuleSnapshot( ruleName, items: ImmutableDictionary>.Empty, properties: properties.ToImmutableDictionary(), dataSourceVersions: ImmutableDictionary.Empty); } public static TestProjectRuleSnapshot CreateItems(string ruleName, Dictionary> items) { return new TestProjectRuleSnapshot( ruleName, items: items.ToImmutableDictionary(kvp => kvp.Key, kvp => (IImmutableDictionary)kvp.Value.ToImmutableDictionary()), properties: ImmutableDictionary.Empty, dataSourceVersions: ImmutableDictionary.Empty); } public TestProjectRuleSnapshot( string ruleName, IImmutableDictionary> items, IImmutableDictionary properties, IImmutableDictionary dataSourceVersions) { RuleName = ruleName; Items = items; Properties = properties; DataSourceVersions = dataSourceVersions; } public string RuleName { get; } public IImmutableDictionary> Items { get; } public IImmutableDictionary Properties { get; } public IImmutableDictionary DataSourceVersions { get; } } }