Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ApplicationSession"/> class.
        /// </summary>
        /// <param name="userRoleService">The user role service.</param>
        /// <param name="userHostService">The user host service.</param>
        /// <param name="userRepository">The user repository.</param>
        public ApplicationSession(
			IUserRoleService userRoleService, 
			IUserHostService userHostService, 
			IRepository<User> userRepository)
        {
            this.UserRoleService = userRoleService;
            this.UserHostService = userHostService;
            this.UserRepository = userRepository;
        }
Example #2
0
        public void Initialize()
        {
            var authentication = MockRepository.GenerateMock<IAuthenticationService>();

            authentication.Stub(x => x.Identity).Return(new FakeUserIdentity());

            var user = MockRepository.GenerateMock<IRepository<User>>();

            user.Stub(x => x.GetById(1)).Return(new User { Id = 1 });

            this.UserHostService = new UserHostService(
                authentication,
                user,
                new FakeUserHostRepository()
            );
        }