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