tags:

views:

372

answers:

1

Hello

i have a very simple question , i'm new to rhino this is my class: i want to test the property with Expect.SetPropertyWithArgument

can anyone show me how, cuase i tried and its not working..

public class person
{    

    public string Name {get;private set;}

    public person(string name)
    {
        Name = name;
    }
}
+1  A: 

The point of Expect.SetPropertyWithArguments is that a property is set on the mocked object, not on the object under test. I'd also point out that the code you've shown doesn't set a property at all - it's setting a field.

Jon Skeet
i ment property... sorry..
Chen Kinnrot
can u show me an example of use?
Chen Kinnrot
See http://ayende.com/Blog/archive/2008/10/09/rhino-mocks-3.5-gems-explicit-property-setting-expectations.aspx but I suspect you don't want to be using it in the first place. Are you really trying to test that a *dependency* property is set? Because that's what the method is for.
Jon Skeet