Пример #1
0
        public void CanResolveResource_Reuses_Previous_Temp_File()
        {
            var resourcePath = "http://example.com";

            var embeddedResourceResolver = new HttpResolver();

            var path  = embeddedResourceResolver.Resolve(resourcePath);
            var path2 = embeddedResourceResolver.Resolve(resourcePath);

            Assert.AreEqual(_htmlContent, File.ReadAllText(path));
            Assert.AreEqual(_htmlContent, File.ReadAllText(path2));

            Assert.AreEqual(path, path2);

            TempFileResolutionCache.Clear();

            Assert.False(File.Exists(path));
        }
Пример #2
0
        public void CanResolveResource()
        {
            var resourcePath = "http://example.com";

            var httpResolver = new HttpResolver();

            var path = httpResolver.Resolve(resourcePath);

            Assert.AreEqual(_htmlContent, File.ReadAllText(path));

            TempFileResolutionCache.Clear();

            Assert.False(File.Exists(path));
        }