You need to use Stub not Expect. Sent from my iPhone
On 31 Dec 2012, at 08:55, M <karimip...@gmail.com> wrote: > Hi > > This is the block of code that I have written to test some method. But it > throws an exception on line 3 that "Value can not be null ". > > IDataRepository repository = MockRepository.GenerateStub<IDataRepository>(); > IKernel kernel = MockRepository.GenerateStub<IKernel>(); > kernel.Expect(k => k.Get<IDataRepository>()).Return(repository); > > > > > What should I do ? > Regards > -- > You received this message because you are subscribed to the Google Groups > "Rhino.Mocks" group. > To view this discussion on the web visit > https://groups.google.com/d/msg/rhinomocks/-/r_ElcSl13asJ. > To post to this group, send email to rhinomocks@googlegroups.com. > To unsubscribe from this group, send email to > rhinomocks+unsubscr...@googlegroups.com. > 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 rhinomocks@googlegroups.com. To unsubscribe from this group, send email to rhinomocks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rhinomocks?hl=en.