c# - Moq item from session -
how can moq following returns new guid();
private void checksomething(){ ... user = customercontext.current.user; // returns guid customercontext taken third party library , not injected class.
is there way it?
i did this.
public class usercontextwrapper : icustomusercontext { public guid userguid { { return customercontext.current.user; } } } then in code had modify original to:
private void checksomething(){ ... user = usercontextwrapper.userguid ; // returns guid now i'm able mock. i'm injecting icustomerusercontext class , have mapped usercontextwrapper icustomusercontext in ioc container.
Comments
Post a Comment