Skip to content

Instantly share code, notes, and snippets.

@eerohele
Created October 8, 2016 15:43
Show Gist options
  • Save eerohele/6839e849710d6aaa0f8c2ec56b469cc9 to your computer and use it in GitHub Desktop.
Save eerohele/6839e849710d6aaa0f8c2ec56b469cc9 to your computer and use it in GitHub Desktop.
Unit testing XSLT with F#
open XSLTUnit
[<TestFixture>]
type ``Testing XSLT with F#``() =
inherit XSLTUnit(Uri(@"C:\TEMP\test.xsl"))
[<Test>]
member xsl.``Applying a template with a tunnel template parameter in the default mode``() =
xsl.Apply("""<input attribute="1"/>""", parameters = parameters Template true [(QName("number"), 42)])
|> should produce """<output attribute="42"/>"""
[<Test>]
member xsl.``Selecting a context node, applying the template for that node, and checking whether the result matches an XPath expression``() =
DocumentNode """<a b="c"/>"""
|> XPath.selectNode("a/@b")
|> xsl.Apply
|> should beMatching "d[empty(*)]"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment