Hi,

The documentation says:

1) public static T GenerateStub<T>(params object[] argumentsForConstructor)
       where T : class
*
Generates a stub without needing a Rhino.Mocks.MockRepository*

2) public T Stub<T>(params object[] argumentsForConstructor)

*Create a stub object, one that has properties and events ready for use, and
can have methods called on it. It requires an explicit step in order to
create an expectation for a stub.*

Can you tell me the difference between 1) and 2). Experimentally I found
that for example when we have this interface:

public interface ITest
{
   DataClass GetSomeData(ParameterClass param);
}

and we create a stub using 2), then the calls to GetSomeData will return a
test double. But if we've created the object, using 1), then calls would
return null. In both cases we haven't prepared the stubs to return
predefined values. What looks to me is happening is that using 2) it will
always return default value for value types and a test double for reference
types.

I find the difference between objects created with 1) and 2) confusing. Is
there a place in the documentation pointing out this and eventually other
differences, so that I can read and choose which one to use?

-- 
Software modules coupling is the path to the dark side.
Coupling leads to complexity.
Complexity leads to confusion.
Confusion leads to suffering.
Once you start down the dark path, forever will it dominate your destiny,
consume you it will!

-- 
You received this message because you are subscribed to the Google Groups 
"Rhino.Mocks" 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/rhinomocks?hl=en.

Reply via email to