Beispiel #1
0
        public void NuGetDependenciesSubTreeProvider_GetDependencyNode_WhenNodeIsInCacheJustReturn()
        {
            var provider = new TestableNuGetDependenciesSubTreeProvider();

            var nodeJson     = @"
{
    ""Id"": {
        ""ProviderType"": ""NuGetDependency"",
        ""ItemSpec"": ""tfm1/PackageToRemove/1.0.0"",
        ""ItemType"": ""PackageReference""
    }
}";
            var existingNode = IDependencyNodeFactory.FromJson(nodeJson);

            provider.SetCurrentSnapshotNodesCache(new[] { existingNode });

            var resultNode = provider.GetDependencyNode(existingNode.Id);

            Assert.Equal(existingNode, resultNode);
        }