public void GetOutputWebPath_NoHash()
        {
            var renderToPath = Guid.NewGuid().ToString();

            var strategy = new HashAsVirtualDirectoryCacheInvalidationStrategy();

            Assert.AreEqual(renderToPath, strategy.GetOutputWebPath(renderToPath, null, null));
        }
        public void GetOutputFileLocation_HashInFolderName()
        {
            var fileLocation = "/#/" + Guid.NewGuid().ToString();
            var hash = "HASH";

            var strategy = new HashAsVirtualDirectoryCacheInvalidationStrategy();

            Assert.AreEqual("/" + fileLocation.TrimStart('/', '#'), strategy.GetOutputFileLocation(fileLocation, hash));
        }
        public void GetOutputFileLocation()
        {
            var fileLocation = Guid.NewGuid().ToString();
            var hash = "HASH";

            var strategy = new HashAsVirtualDirectoryCacheInvalidationStrategy();

            Assert.AreEqual(fileLocation, strategy.GetOutputFileLocation(fileLocation, hash));
        }
        public void GetOutputWebPath_Querystring()
        {
            var renderToPath = Guid.NewGuid().ToString() + "?something=somethingelse";
            var hashKeyName = Guid.NewGuid().ToString();
            var hash = Guid.NewGuid().ToString();

            var strategy = new HashAsVirtualDirectoryCacheInvalidationStrategy();

            Assert.AreEqual(renderToPath + "&" + hashKeyName + "=" + hash, strategy.GetOutputWebPath(renderToPath, hashKeyName, hash));
        }
        public void GetOutputWebPath_HashInFolderName()
        {
            var renderToPath = "/#/" + Guid.NewGuid().ToString();
            var hashKeyName = Guid.NewGuid().ToString();
            var hash = Guid.NewGuid().ToString();

            var strategy = new HashAsVirtualDirectoryCacheInvalidationStrategy();

            Assert.AreEqual(renderToPath.Replace("#", hashKeyName + "-" + hash), strategy.GetOutputWebPath(renderToPath, hashKeyName, hash));
        }