public void TransformsWithImports() { IXSL xsl = new XSLEnvelopeImplementation( new TextOf( new ResourceOf( "Resources/first.xsl", Assembly.GetExecutingAssembly() ) ), new SourcesEmpty(), new MapOf <string, object>() ).With( new SourcesEmbedded( Assembly.GetExecutingAssembly(), "Resources" ) ); Assert.Equal( 1, xsl.Transformed( new XMLCursor( "<simple-test/>" ) ).Nodes("/result[.=6]").Count ); }
public void ReturnsSource() { var xsl = new XSLEnvelopeImplementation( new TextOf( new ResourceOf( "Resources/first.xsl", Assembly.GetExecutingAssembly() ) ), new SourcesEmpty(), new MapOf <String, Object>() ); Assert.Contains( "<xsl:with-param name=\"value\" select=\"5.67\"", xsl.ToString() ); }
public void TransformsToText() { IXSL xsl = new XSLEnvelopeImplementation( new TextOf( new ResourceOf( "Resources/CreatesHello.xsl", Assembly.GetExecutingAssembly() ) ), new SourcesEmpty(), new MapOf <string, object>() ); Assert.Equal( "hello", xsl.TransformedToText( new XMLCursor("<something/>") ) ); }
public void MakesXslTransformations(string input, string expected) { IXSL xsl = new XSLEnvelopeImplementation( new TextOf( new ResourceOf( "Resources/CreatesDone.xsl", Assembly.GetExecutingAssembly() ) ), new SourcesEmpty(), new MapOf <string, object>() ); Assert.Equal( 1, xsl.Transformed( new XMLCursor(input) ).Nodes(expected).Count ); }
public void HandlesXsltExctption() { IXSL xsl = new XSLEnvelopeImplementation( new TextOf( new ResourceOf( "Resources/first.xsl", Assembly.GetExecutingAssembly() ) ), new SourcesEmpty(), new MapOf <string, object>() ); Assert.Throws <ArgumentException>(() => xsl.Transformed( new XMLCursor( "<simple-test/>" ) ) ); }
public void TransformsToTextWithParams() { IXSL xsl = new XSLEnvelopeImplementation( new TextOf( new ResourceOf( "Resources/ValueOfBoom.xsl", Assembly.GetExecutingAssembly() ) ), new SourcesEmpty(), new MapOf <string, object>() ); Assert.Equal( "[Donny]", xsl .With("boom", "Donny") .TransformedToText( new XMLCursor("<ehe/>") ) ); }
public void TransformsToTextWithIntegerParams() { IXSL xsl = new XSLEnvelopeImplementation( new TextOf( new ResourceOf( "Resources/ValueOfFaa.xsl", Assembly.GetExecutingAssembly() ) ), new SourcesEmpty(), new MapOf <string, object>() ); Assert.Equal( "+1+", xsl .With("faa", 1) .TransformedToText( new XMLCursor("<r0/>") ) ); }