Esempio n. 1
0
            public void Minify()
            {
                // Given
                // Example taken from http://yui.github.io/yuicompressor/css.html
                string input  = @"
/*****
  Multi-line comment
  before a new class name
*****/
.classname {
    /* comment in declaration block */
    font-weight: normal;
}";
                string output = @".classname{font-weight:normal}";

                IExecutionContext context  = Substitute.For <IExecutionContext>();
                IDocument         document = Substitute.For <IDocument>();

                document.Content.Returns(input);

                MinifyCss minifyCss = new MinifyCss();

                // When
                minifyCss.Execute(new[] { document }, context).ToList();  // Make sure to materialize the result list

                // Then
                context.Received(1).GetDocument(Arg.Any <IDocument>(), Arg.Any <string>());
                context.Received().GetDocument(document, output);
            }
Esempio n. 2
0
            public void Minify()
            {
                // Given
                // Example taken from http://yui.github.io/yuicompressor/css.html
                string input = @"
/*****
  Multi-line comment
  before a new class name
*****/
.classname {
    /* comment in declaration block */
    font-weight: normal;
}";
                string output = @".classname{font-weight:normal}";

                IExecutionContext context = Substitute.For<IExecutionContext>();
                IDocument document = Substitute.For<IDocument>();
                document.Content.Returns(input);

                MinifyCss minifyCss = new MinifyCss();

                // When
                minifyCss.Execute(new[] { document }, context).ToList();  // Make sure to materialize the result list

                // Then
                context.Received(1).GetDocument(Arg.Any<IDocument>(), Arg.Any<string>());
                context.Received().GetDocument(document, output);
            }
Esempio n. 3
0
            public void Minify()
            {
                // Given
                // Example taken from http://yui.github.io/yuicompressor/css.html
                string input  = @"
/*****
  Multi-line comment
  before a new class name
*****/
.classname {
    /* comment in declaration block */
    font-weight: normal;
}";
                string output = @".classname{font-weight:normal}";
                TestExecutionContext context   = new TestExecutionContext();
                TestDocument         document  = new TestDocument(input);
                MinifyCss            minifyCss = new MinifyCss();

                // When
                IList <IDocument> results = minifyCss.Execute(new[] { document }, context).ToList();  // Make sure to materialize the result list

                // Then
                results.Single().Content.ShouldBe(output, StringCompareShould.IgnoreLineEndings);
            }
Esempio n. 4
0
            public void Minify()
            {
                // Given
                // Example taken from http://yui.github.io/yuicompressor/css.html
                string input  = @"
/*****
  Multi-line comment
  before a new class name
*****/
.classname {
    /* comment in declaration block */
    font-weight: normal;
}";
                string output = @".classname{font-weight:normal}";
                TestExecutionContext context   = new TestExecutionContext();
                TestDocument         document  = new TestDocument(input);
                MinifyCss            minifyCss = new MinifyCss();

                // When
                IList <IDocument> results = minifyCss.Execute(new[] { document }, context).ToList();  // Make sure to materialize the result list

                // Then
                Assert.That(results.Select(x => x.Content), Is.EquivalentTo(new[] { output }));
            }