Hello.

I have just started using Rhino mocks and have a little question. Many
of our interfaces have properties, but the set method is omitted. The
properties are set in the class that implements the interface. Is
there a way to use Rhino Mocks to stub interface like that?

I keep gettign this compilation error.
error CS0200: Property or indexer IManagedAlarmProperty.DataType'
cannot be assigned to -- it is read only

Here is my interface:
 public interface IManagedAlarmProperty
    {
        /// <summary>
        /// Property value
        /// </summary>
        object Value { get; }

        /// <summary>
        /// datatype of property
        /// </summary>
        Type DataType { get; }
    }

Here is my method that stubs this interface.
        static IManagedOskAlarmProperty CreateAlarmProperty(string
property)
        {
            IManagedOskAlarmProperty alarmPropertyStub =
MockRepository.GenerateStub<IManagedOskAlarmProperty>();
            alarmPropertyStub.DataType = typeof(double);       <---
compilation error.
            alarmPropertyStub.Value = 1;
<-- compilation error.
return alarmPropertyStub;
        }



Thanks,
Kai
-- 
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