internal static bool MustMinify(IResourceElementGroupConfiguration resourceElementGroupConfiguration, ResourceElement resourceElement)
 {
     return (resourceElement.Minify.HasValue && resourceElement.Minify.Value) ||
            (!resourceElement.Minify.HasValue && resourceElementGroupConfiguration.Minify);
 }
        public void ReadResource(string content, string fileName, string fileModifyDate)
        {
            Mock<IResourceReaderManager> resourceReaderManagerMock = new Mock<IResourceReaderManager>();
            ResourceInfo resourceInfo = new ResourceInfo { Content = content, DependentFile = fileName, ModifyDate = DateTime.Parse(fileModifyDate, CultureInfo.InvariantCulture) };
            resourceReaderManagerMock.Setup(x => x.ReadResource(It.IsAny<ResourceReadOptions>()))
                                     .Returns(() => resourceInfo);
            ResourceProcessor resourceProcessor = CreateResourceProcessor(new Mock<IResourceCacher>(), resourceReaderManagerMock,
               new Mock<ICompressionFactory>(), new Mock<IResourceHasher>(), new Mock<IJsMinifier>(), new Mock<ICssMinifier>(), new Mock<IVirtualPathProvider>());

            ResourceElement resourceElement = new ResourceElement {FileName = fileName, IsEmbeddedResource = true};
            IList<ResourceReadInfo> resourceReadInfos = resourceProcessor.ReadResources(ResourceType.Js, new ResourceElementCollection { resourceElement });
            List<ResourceReadInfo> expectedResourceInfos = new List<ResourceReadInfo>
                {
                    new ResourceReadInfo {ResourceInfo = resourceInfo, ResourceElement = resourceElement}
                };
            Assert.AreEqual(expectedResourceInfos[0].ResourceElement, resourceReadInfos[0].ResourceElement);
            Assert.AreEqual(expectedResourceInfos[0].ResourceInfo, resourceReadInfos[0].ResourceInfo);
        }
 private ResourceInfo ReadResource(ResourceElement resourceElement)
 {
     return ReadResource(resourceElement.FileName, resourceElement.IsEmbeddedResource, resourceElement.IsHttpResource);
 }