I'll be honest in that I don't run into this problem very often because I almost always try to have an interface in there...and as Caio pointed out, it's not a problem that shows up when programming interfaces.
Tim On Mon, Jan 4, 2010 at 1:53 PM, Caio Kinzel Filho <[email protected]> wrote: > I think most of the time, when you are programming against interfaces > rather than against implementations, you will not have that problem, > once rhino.mocks can just implement that interface instead of > inheriting from your implementation > > On Mon, Jan 4, 2010 at 5:49 PM, Wigman <[email protected]> wrote: > > Ok, now I know, thanx a million! Too bad i have to adjust the > > 'visibility' of my methods just to get the testing part in order. > > > > On Jan 4, 4:02 pm, Jonathon Rossi <[email protected]> wrote: > >> The Test method is not virtual, so RhinoMocks cannot override it to do > >> nothing. > >> > >> > >> > >> > >> > >> On Tue, Jan 5, 2010 at 12:40 AM, Wigman <[email protected]> > wrote: > >> > 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]<rhinomocks%[email protected]> > <rhinomocks%2bunsubscr...@googlegrouÂps.com> > >> > . > >> > For more options, visit this group at > >> >http://groups.google.com/group/rhinomocks?hl=en. > >> > >> -- > >> Jono- Hide quoted text - > >> > >> - Show quoted text - > > > > -- > > > > 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]<rhinomocks%[email protected]> > . > > For more options, visit this group at > http://groups.google.com/group/rhinomocks?hl=en. > > > > > > > > -- > > 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]<rhinomocks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/rhinomocks?hl=en. > > > -- Tim Barcz Microsoft C# MVP Microsoft ASPInsider http://timbarcz.devlicio.us http://www.twitter.com/timbarcz -- 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.
