public void Open_NoNodes_ThrowsInvalidOperationException() { // Arrange var strategy = new ResourceResolverStrategy(); strategy.SetFirst(null); // Act strategy.Open(new PathDefinition(), "~/Test"); }
public void GetCacheDependency_ReturnsFirstNodesCacheDependency() { var strategy = new ResourceResolverStrategy(); var nodeCacheDependency = new CacheDependency(Directory.GetCurrentDirectory()); var node = new DummyResourceResolverNode(); strategy.SetFirst(node); node.GetCurrentCacheDependencyMock = (pathDefinition, virtualPath, virtualPathDependencies, utcStart) => nodeCacheDependency; var resultCacheDependency = strategy.GetCacheDependency(new PathDefinition(), "~/Test", null, DateTime.UtcNow); Assert.AreSame(nodeCacheDependency, resultCacheDependency, "GetCacheDependency did not return the instance that is provided by the node in the strategy."); }