public StylesheetPipeline_Process_TestBase() { settings = new CassetteSettings(); bundle = new StylesheetBundle("~"); asset1 = new Mock <IAsset>(); asset2 = new Mock <IAsset>(); bundle.Assets.Add(asset1.Object); bundle.Assets.Add(asset2.Object); asset1.SetupGet(a => a.Path) .Returns("~/asset1.css"); asset1.Setup(a => a.OpenStream()) .Returns(() => "/* @reference \"asset2.css\"; */".AsStream()); asset2.SetupGet(a => a.Path) .Returns("~/asset2.css"); asset2.Setup(a => a.OpenStream()) .Returns(() => "p { color: White; }".AsStream()); asset1.SetupGet(a => a.References) .Returns(new[] { new AssetReference(asset1.Object.Path, "~/asset2.css", -1, AssetReferenceType.SameBundle) }); minifier = new MicrosoftStylesheetMinifier(); urlGenerator = new Mock <IUrlGenerator>(); container = new TinyIoCContainer(); container.Register(minifier); container.Register(urlGenerator.Object); container.Register(settings); }
public void TransformMinifiesCss() { var minifier = new MicrosoftStylesheetMinifier(); var getResult = minifier.Transform(() => "p { color: White; }".AsStream(), Mock.Of<IAsset>()); using (var result = getResult()) { result.ReadToEnd().ShouldEqual("p{color:#fff}"); } }
public void TransformMinifiesCss() { var minifier = new MicrosoftStylesheetMinifier(); var getResult = minifier.Transform(() => "p { color: White; }".AsStream(), new StubAsset()); using (var result = getResult()) { result.ReadToEnd().ShouldEqual("p{color:#fff}"); } }
public StylesheetPipeline() { StylesheetMinifier = new MicrosoftStylesheetMinifier(); }
public StylesheetPipeline() { StylesheetMinifier = new MicrosoftStylesheetMinifier(); CompileLess = true; }