When stubbing a class i expect the original class code is not
executed. However, the following example does throw an exception("We
don't expect this to be thrown"). I thought stubs never failed a test.
What am I doing wrong here? How can i make Rhino stub the existing
class properly, so calling Test() does not give errors?
using System;
using NUnit.Framework;
using Rhino.Mocks;
namespace Roxit.Link.Test
{
[TestFixture]
public class RhinoTest
{
[Test]
public void TestStub()
{
Onzin onzin = MockRepository.GenerateStub<Onzin>();
onzin.Test();
}
public class Onzin
{
public void Test()
{
throw new Exception("We don't expect this to be
thrown");
}
}
}
}
--
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.