FAQ 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. Thanks to Julien Couvreur for the questions.
  2. Q: You mention that the test gets invoked in the web appdomain. But does
  3. this have any impact on the kind of tests that you can do?
  4. A: I'm not aware of any impact yet.
  5. Q: Does that mean that the test class would need to be serializable if it
  6. needs to keep any state?
  7. A: This turned out to be a complex problem. If you pass a delegate to
  8. another appdomain, it's serialized only in one way. So, if during this
  9. delegate you change instance fields, those changes will be lost. I could
  10. not work around this problem with passing delegate by ref, because then a
  11. new instance is created and the original remains intact. So to provide an
  12. ability to pass user data back and forth, I made WebTest.UserData property.
  13. If few WebTest's run in different threads, each one has it's own UserData.
  14. Q: Do you really think that there is going to be different types of hooks?
  15. Currently, you have BaseInvoker and PageInvoker, but maybe the base class
  16. is superfluous?
  17. A: Currently, there are 3 Invokers: BaseInvoker, HandlerInvoker and
  18. PageInvoker.
  19. BaseInvoker is a stub, only ensuring somebody called it. It exists for
  20. tests that need no callback, for example for rendering some aspx page.
  21. HandlerInvoker enables to execute a method without parameters in the web
  22. appdomain. NET 2.0 anonymous delegates are useful here. There is no need to
  23. instrument anything for this invoker, or to set the URL of the request, the
  24. DefaultUrl of the HandlerInvoker is sufficient.
  25. PageInvoker calls a method with Page argument, and is used when the test
  26. must work on a web page. The page must be instrumented to enable the
  27. framework to do its job.