I recently upgraded to RhinoMocks 3.6 and Castle.Windsor 2.1. I
started having an issue with a shadowed property, something like this:

public interface INamedObject
{
   public string DisplayName {get;}
}

public interface IFeature : INamedObject
{
   new public string DisplayName {get;set;}
}

 [TestMethod]
 public void TestMethodThatFails()
 {
     var feature = MockRepository.GenerateStub<IFeature>();
     feature.DisplayName = "some name";

     Assert.AreEqual("some name", feature.DisplayName);
     Assert.AreEqual("some name",
((INamedObject)feature).DisplayName);
 }

 [TestMethod]
 public void TestMethodThatPasses()
 {
     var feature = MockRepository.GenerateStub<IFeature>();
     feature.DisplayName = "some name";
     ((INamedObject)feature).DisplayName = "some name";

     Assert.AreEqual("some name", feature.DisplayName);
     Assert.AreEqual("some name",
((INamedObject)feature).DisplayName);
 }

Although there is this workaround, is this a breaking change or a bug?

I have detailed it on my blog:
http://smoura.com/index.php/tdd/2010/02/06/rhinomocks-stub-not-retaining-value-when-property-shadowed-on-inheriting-interface/

-- 
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