I have a piece of code:
EDIT: The _penParams are initialized as the added line below.
ProjectionParameters _penParams = new ProjectionParameters();
[Given(@"Rate Rule List $raterule")]
public void Rate_Rule_List(Int32 raterule)
{
_penParams.RateRuleIds.Initialize();
_penParams.RateRuleIds.Add(raterule);
}
It references an integer array defined as:
private Collection<Int32> rateRuleIds;
/// <summary>
/// A collection of rate rule Ids the member has selected. This is only relevant for an AgeServiceOptions Rates Mode.
/// </summary>
public Collection<Int32> RateRuleIds
{
get { return rateRuleIds; }
}
Two things have happened:
- The .Add method is not available to me when I try to compile, it was available in a previous instance, but has disappeared since I switched from working directly with the DLL to calling a web service to do my testing.
- If I try to access any part of the array, any of its properties, I get a "System.NullReferenceException : Object reference not set to an instance of an object" error.
Any thoughts would be greatly appreciated!
BTW: I am using NBehave to develop a simple syntax to allow non techie people specify end user conditions to be tested.