c# - How to pass a parameter in an expectation to the return value in Rhino Mocks? -


i want mock interface:

interface ia {   ib dosomething(ic arg) } 

in way simulates implementation this:

class : ia {     public ib dosomething(ic arg) { return new b(arg); } } 

how can that? other similar questions, it's supposed this:

mockrepository.generatemock<ia>().expect(x => x.dosomething(null)).ignorearguments().callback<ic>(arg => new b(arg)) 

but can't work. i'm using rhinomocks 3.6

here typesafe example:

var mocka = mockrepository.generatemock<ia>(); mocka     .stub(x => x.dosomething(arg<ic>.is.anything))     .do((func<ic, ib>)(arg => new b(arg)))     .return(null); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -