Hi Chadwick,
Thanks again for bringing up the question.
Here I changed the declaration of
IsAdministrator method in this way :
Instead of using
_Roles field, I modified it to use the corresponding property.
Next I modified your test in this way:
During
Mock.Create I used the
Behavior.CallOriginal argument. However, if you want to keep your
User class untouched then you can just do this:
Because you are creating the Mock of
User class, calling any member will return default value unless specifically arranged or in other words it will act as a stub.
Hope this answers your question.
Kind Regards
Ricky
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>