Re: XSLT Test Pattern
"Charlie Poole" <[email protected]>
| Newsgroups | gmane.comp.windows.dotnet.nunit.user |
|---|---|
| Message-ID | <014c01c825a3$3c76ba50$6401a8c0@FERRARI> |
Hi Anthony, I held off responding to this till I could review your blog entry and some of the mbUnit stuff. There are two kinds of differences between how MbUnit uses attributes and how NUnit uses them. 1) The NUnit set is not as rich as MbUnits. NUnit is aiming at extended attributes similar to MbUnit being provided as extensions, not as part of a monolithic package. This is coming along, but I wish it were faster. 2) NUnit's attributes do not specify anything about how the attribute will be interpreted. They are purely descriptive. You can write an addin that makes a TestFixture attribute do something entirely different from the default. In other words, a test in NUnit does not control how it is run, the runner controls it. Anything that can be done in NUnit can be done in MbUnit, and vice versa. However, you have to take a different view to do them in each environment. In fact, the entire MbUnit approach of specifying a SequenceRun in the attribute itself could itself be emulated using an NUnit addin. With respect to your XSLT Test Pattern, it too could be implemented as an NUnit addin. However, it may be more useful to consider a generic fixture creation addin, which takes any argument and passes it to setup or makes it available in some other way. Similarly, tests with arguments are a requested feature, which we have put off until the addin facility can handle them - and someone has time and interest to implement them. Do you want to try to implement any of this? There's a bit of tradeoff, as you know, between doing it in the current version and waiting for our more complete addin facility in NUnit 3.0. I'd be glad to see some discussion on NUnitv3 around how this sort of thing might influence the design of NUnit 3.0. Charlie _____ From: [email protected] [mailto:[email protected]] On Behalf Of Nassar, Anthony Sent: Tuesday, November 06, 2007 7:12 AM To: [email protected] Subject: [Nunit-users] XSLT Test Pattern I have to admit that I gave MbUnit a spin recently. It's packaged somewhat haphazardly, but its design is provocative. Basically, it's gone all the way toward using metadata to declare much more complex patterns than I had been using. You can see my blog entry here <http://slideguitarist.blogspot.com/2007/11/mbunit-vs-nunit-cage-match.html> , if you're interested. There is a pattern I use all the time: load XML with or without validation, with or without an XmlResolver; pass it through 1 or more XSL transforms, with or without an XmlResolver; apply XPath expressions using namespaces and assert something about what I get back. I don't want XML diffing, by the way. Of course I could do all this in my TestFixtureSetUp, or create an abstact base class that does the setup by calling virtual protected methods that implement the steps in the "template pattern" I describe above, but then I'd be mixing NUnit's declarative design with an imperative design. It's kind of handy, though, to have a "test invoker" inject node sets or scalar values that come back from the XPathNavigator object that the fixture (or the fixture "runner") is maintaining for me. So: is there an idiomatic way to do some of these things in NUnit? Namely, declare a fixture setup pattern, and get the test runner to invoke my [Test] methods with arguments? Should I cross-post this to the Version 3 Development group? _____ Cell: (703) 994-0954 Blog: <blocked::http://slideguitarist.blogspot.com/> http://slideguitarist.blogspot.com/ Music: <http://www.soundclick.com/thecompletists> http://www.soundclick.com/thecompletists "God love me, and I'm a hell of a fighter.." - Floyd Mayweather ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Nunit-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/nunit-users