core-jgi/fitnesse/FitNesseRoot/FitLibrary/UserGuide/FaQ4Programmers/content.txt

35 lines
2.6 KiB
Plaintext
Raw Normal View History

!2 FAQ for Programmers
----!3 How do I debug my storytest fixtures, etc?
* See DebugCapability
----!3 How do I handle null as a special String value?
* See .FitLibrary.UserGuide.FitLibraryByExample.TextToValues
----!3 How do I handle specialised Date (or other) formats?
* See .FitLibrary.UserGuide.FitLibraryByExample.TextToValues
----!3 What if I can't add a static ''parse()'' method to someone else's class?
* See .FitLibrary.UserGuide.FitLibraryByExample.TextToValues
----!3 How to do some processing before and/or after a fixture (or traverse or domain adapter) does its work:
* See FitLibraryByExample.WorkFlow.SetUpTearDown
----!3 How to keep the HTML tags within a table cell, as they're important to the test:
* See ^KeepTags
----!3 Flow style with ''!-DoFixture-!'' doesn't work when I use an Import table
* That's because the fixture of the first table of a storytest has to be a ''!-DoFixture-!'' for flow to be used.
* However, there's no need for the Import table in flow style, because there's no need to mention fixture names after the first one with ''!-DoFixture-!''
----!3 What's the point of removing fixture names?
* They add technical complexity to the storytests that are best hidden away from customers who read/write storytests
* It's then possible to substitute different fixtures without having to change the storytests
----!3 What's the point of substituting fixtures?
* The same storytests can be used to test a system at different levels
* Some fixtures are used to test the system under test directly at the domain layer
* Other fixtures could have some extra code to instead test the system through a UI or some other interface
* Some fixtures could generates user documentation from some of the storytests
----!3 My tests used to pass, but they fail with the latest ''!-FitLibrary-!''
* Here's one possibility, if you've been using ''parse delegates'':
* In the latest version, all registered ''parse delegates'' are cleared at the end of a test, to avoid potentially confusing interactions between tests (''test indepedence'' is a fundamental principle of storytesting).
* Perhaps your tests previously depended on this interaction?
* If so, you'll need to ensure that ''parse delegates'' are registered for each test.
* That's easy if you use the same (''!-DoFixture-!'') class to start all your tests: simply register the ''parse delegates'' in the constructor of the class. That is, don't do it in a ''static { ... }'' block.
----!3 How can I avoid duplicating code in several fixture subclasses?
* It is no longer necessary to subclass ''!-FitLibrary-!'' fixtures
* See DomainAdapter