I'm currently working on a ViewComponent however I'm struggling the
testing side of things.

The ViewComponent uses the FormHelper within it.

formHelper = new FormHelper(EngineContext);

and is creating a series of TextFields dynamically

formHelper.TextField(fieldId)

This works fine when running the view.  However when running the test
which inherits from BaseViewComponentTest I'm getting the following
error message when the formHelper.TextField(fieldId) code is run.

System.NullReferenceException: Object reference not set to an instance
of an object.
at
Castle.MonoRail.Framework.Helpers.AbstractFormRelatedHelper.ObtainRootInstance
(RequestContext context, String target)
at
Castle.MonoRail.Framework.Helpers.AbstractFormRelatedHelper.ObtainRootInstance
(RequestContext context, String target, String[]& pieces)
at
Castle.MonoRail.Framework.Helpers.AbstractFormRelatedHelper.ObtainValue
(RequestContext context, String target)
at
Castle.MonoRail.Framework.Helpers.AbstractFormRelatedHelper.ObtainValue
(String target)
at
Castle.MonoRail.Framework.Helpers.AbstractFormRelatedHelper.ObtainValue
(String target, IDictionary attributes)
at Castle.MonoRail.Framework.Helpers.FormHelper.TextField(String
target, IDictionary attributes)
at Castle.MonoRail.Framework.Helpers.FormHelper.TextField(String
target)

Is there something I'm missing?  I've seen this discussion about the
lack of PropertyBag http://markmail.org/message/xremym6hthsudx4o but
as I said the same code works fine when running the viewcomponent in
the view.

Hope this makes sense

John
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to