Closed GoogleCodeExporter closed 8 years ago
Original comment by kzu.net
on 25 Oct 2009 at 4:11
This still happens with 4.0.812.4. The cause seems to be that IDataErrorInfo
defines
an indexer, which is implemented as a property whose get/set methods take a
parameter.
I would propose modifying Moq.Extensions.CanOverrideGet() to read
return getter != null && getter.IsVirtual && !getter.IsFinal &&
(getter.GetParameters() == null || getter.GetParameters().Count() == 0);
I've also written this regression test which fails without this modification
and
passes with this modification:
#region #205
public class _205
{
public interface IIndexer
{
string this[string param] { get; }
}
[Fact]
public void Test()
{
var mock = new Mock<IIndexer>();
Assert.DoesNotThrow(() => mock.SetupAllProperties());
}
}
#endregion
Original comment by david.black.co.at@gmail.com
on 11 Feb 2010 at 11:19
Original comment by kzu.net
on 11 Feb 2010 at 3:34
Indexers excluded from SetupAllProperties
Original comment by marian...@gmail.com
on 20 Feb 2010 at 11:51
Issue 225 has been merged into this issue.
Original comment by marian...@gmail.com
on 13 May 2010 at 5:13
Original issue reported on code.google.com by
cliftonf...@gmail.com
on 27 Aug 2009 at 11:34