public void GetCacheDependency_NoCurrentDependencyCurrentExistsFalse_ReturnsNextCacheDependency()
        {
            // Arrange
            var currentNode = new DummyResourceResolverNode();

            currentNode.GetCurrentCacheDependencyMock = (pathDefinition, virtualPath, virtualPathDependencies, utcDate) => null;
            currentNode.CurrentExistsMock = (pathDefinition, virtualPath) => false;

            var nextCacheDependency = this.SetNextNode(currentNode);

            // Act
            var result = currentNode.GetCacheDependency(new PathDefinition(), "~/Test", null, DateTime.UtcNow);

            // Assert
            Assert.IsNotInstanceOfType(result, typeof(AggregateCacheDependency), "The result of GetCacheDependency methods should be instance of AggregateCacheDependency");
            Assert.AreSame(nextCacheDependency, result, "The returned cache dependency is not that of the second node.");
        }
        public void GetCacheDependency_HasCurrentDependencyCurrentExistsFalse_AggregatesCurrentCacheDependencyWithNext()
        {
            // Arrange
            var currentNode = new DummyResourceResolverNode();

            var currentCacheDependency = new CacheDependency(Directory.GetCurrentDirectory());
            currentNode.GetCurrentCacheDependencyMock = (pathDefinition, virtualPath, virtualPathDependencies, utcDate) => currentCacheDependency;
            currentNode.CurrentExistsMock = (pathDefinition, virtualPath) => false;

            var nextCacheDependency = this.SetNextNode(currentNode);

            // Act
            var result = currentNode.GetCacheDependency(new PathDefinition(), "~/Test", null, DateTime.UtcNow);

            // Assert
            Assert.IsInstanceOfType(result, typeof(AggregateCacheDependency), "Resulting cache dependency is not aggregated.");

            var dependencies = this.GetAggregatedDependencies((AggregateCacheDependency)result);

            Assert.AreEqual(2, dependencies.Count, "The dependencies count is not correct.");
            Assert.IsTrue(dependencies.Contains(currentCacheDependency), "The resulting aggregated cache dependency does not contain the dependency of the first node.");
            Assert.IsTrue(dependencies.Contains(nextCacheDependency), "The resulting aggregated cache dependency does not contain the dependency of the second node.");
        }