private void SetupController() { _controller = new TopicController(_unitOfWork.Object, _imageFileGenerator.Object); _request = new Mock <HttpRequestBase>(); _user = new Mock <IPrincipal>(); _controller.MockContext(_request, _user); _identity = _user.MockIdentity("1"); }
public void Setup() { _context = new iKnowContext(); _contextAfterAction = new iKnowContext(); _controller = new TopicController(new UnitOfWork(new iKnowContext()), new FileHelper()); _currentUser = new Mock <IPrincipal>(); _controller.MockContext(new Mock <HttpRequestBase>(), _currentUser); _firstUserInDb = _context.Users.First(); _currentUser.MockIdentity(_firstUserInDb.Id); }