Blah... I should have written a test case to isolate the issue. The
following snippet is working, which means I must have some other kind
of evil lurking in my test case...
[TestFixture]
public class EnumeratorTest
{
[Test]
public void Should_add_numbers_and_produce_total()
{
var numbers = MockRepository.GenerateStub<INumbers>();
numbers.Stub(x => x.GetEnumerator()).Return(new List<int>
{ 1, 2, 3 }.GetEnumerator());
var sut = new NumberAdder();
var total = sut.Total(numbers);
Assert.AreEqual(6, total);
}
}
public class NumberAdder
{
public int Total(INumbers numbers)
{
return numbers.Sum();
}
}
public interface INumbers : IEnumerable<int> { }
I will report back if I need more help. Thanks.
On Dec 22, 7:47 pm, "Ayende Rahien" <
aye...@ayende.com> wrote:
> It look like it should work.
> can you post a full test case?
>