Guest User

Untitled

a guest
Jan 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. public class BaseController : Controller
  2. {
  3. private IAuthenticationManager authenticationManager;
  4. public ILog log;
  5.  
  6. public BaseController()
  7. {
  8. var kernel = new StandardKernel();
  9. kernel.Load(Assembly.GetExecutingAssembly());
  10. log = kernel.Get<ILog>();
  11. }
  12. }
  13.  
  14. public interface ILog
  15. {
  16. AuditTrail Create(AuditAction action, string description = null);
  17. AuditTrail Create(AuditAction action, long reservationId, string description = null);
  18. AuditTrail Create(IUser user, AuditAction action);
  19. AuditTrail Create(IUser user, AuditAction action, string description = null);
  20. AuditTrail Create(IUser user, AuditAction action, long reservationId, string description = null);
  21. }
  22.  
  23. mockingKernal = new MoqMockingKernel();
  24. mockingKernal.Bind<ILog>().To<Logging.Log>();
  25. var foo = mockingKernal.GetMock<ILog>();
  26. foo.Setup(x => x.Create(It.IsAny<AuditAction>(), It.IsAny<long>(), It.IsAny<string>()));
Add Comment
Please, Sign In to add comment