public void CanCastConcreteLinqRepositoryToInterfaceILinqRepository()
        {
            LinqRepository <MyEntity>  concreteRepository = new LinqRepository <MyEntity>();
            ILinqRepository <MyEntity> castRepository     = concreteRepository as ILinqRepository <MyEntity>;

            castRepository.ShouldNotBeNull();
        }
示例#2
0
 public SearchTasks(
     ILinqRepository<Assertion> assertionRepository,
     ILinqRepository<Tag> tagRepository)
 {
     this.assertionRepository = assertionRepository;
     this.tagRepository = tagRepository;
 }
 public SearchTasks(
     ILinqRepository <Assertion> assertionRepository,
     ILinqRepository <Tag> tagRepository)
 {
     this.assertionRepository = assertionRepository;
     this.tagRepository       = tagRepository;
 }
 public void EachTestSetUp()
 {
     _passwordHashingService = Substitute.For<IPasswordHashingService>();
     _passwordHashingService.ComputeHash("somestring", new byte[4]).ReturnsForAnyArgs("hashedPassword");
     _userRepository = Substitute.For<ILinqRepository<User>>();
     _authService = new AuthenticationService(_userRepository, _passwordHashingService);
 }
        protected override void OnSetup()
        {
            base.OnSetup();

            Repository = RepositoryFactory();
            SessionFactory.Statistics.Clear();
        }
示例#6
0
 public AdminController(ILinqRepository<RentalProperty> propertyRepository,
    ILinqRepository<User> userRepository, ILinqRepository<Agent> agentRepository)
 {
     _propertyRepository = propertyRepository;
     _userRepository = userRepository;
     _agentRepository = agentRepository;
 }
示例#7
0
 public HomeController(IAuthenticationService authenticationService,
     ILinqRepository<Agent> agentRepository,
     ILinqRepository<User> userRepository)
 {
     _authenticationService = authenticationService;
     _agentRepository = agentRepository;
     _userRepository = userRepository;
 }
        public void wrong_email_address_cannot_log_in()
        {
            _userRepository = Substitute.For<ILinqRepository<User>>();
            _authService = new AuthenticationService(_userRepository, _passwordHashingService);
               var result = _authService.Login("invalidAddress", "SomePassword");

            Assert.AreEqual(LoginResult.unsuccessful, result);
        }
 public AgentManagementController(ILinqRepository<Agent> agentRepository,
      ILinqRepository<User> userRepository, ILinqRepository<Office> officeRepository,
     ILinqRepository<RentalProperty> propertyRepository)
 {
     _agentRepository = agentRepository;
     _userRepository = userRepository;
     _officeRepository = officeRepository;
     _propertyRepository = propertyRepository;
 }
示例#10
0
 public ProfileTasks(
     ILinqRepository<Profile> profileRepository, 
     ILinqRepository<Tag> tagRepository,
     ILinqRepository<Category> categoryRepository)
 {
     this.profileRepository = profileRepository;
     this.tagRepository = tagRepository;
     this.categoryRepository = categoryRepository;
 }
示例#11
0
 public ProfileTasks(
     ILinqRepository <Profile> profileRepository,
     ILinqRepository <Tag> tagRepository,
     ILinqRepository <Category> categoryRepository)
 {
     this.profileRepository  = profileRepository;
     this.tagRepository      = tagRepository;
     this.categoryRepository = categoryRepository;
 }
示例#12
0
        public BasicService(IServiceProvider provider, ILinqRepository <T> _repo)
        {
            provider.Should().NotBeNull();
            _repo.Should().NotBeNull();

            this._provider = provider;
            this._repo     = _repo;
            this._logger   = provider.Resolve_ <ILogger <BasicService <T> > >();
        }
示例#13
0
        /// <summary>
        ///     Creates AnnouncementController.
        /// </summary>
        /// <param name="announcementRepository">Announcements repository.</param>
        public AnnouncementsController([NotNull] ILinqRepository <Announcement> announcementRepository,
#if NETCOREAPP3_1
                                       LinkGenerator linkGenerator,
#endif
                                       [NotNull] IMapper mapper)
        {
            _announcementRepository = announcementRepository ?? throw new ArgumentNullException(nameof(announcementRepository));
#if NETCOREAPP3_1
            _linkGenerator = linkGenerator ?? throw new ArgumentNullException(nameof(linkGenerator));
#endif
            _mapper = mapper ?? throw new ArgumentNullException(nameof(mapper));
        }
示例#14
0
 public CategoryTasks(ILinqRepository <Category> categoryRepository)
 {
     this.categoryRepository = categoryRepository;
 }
示例#15
0
 public AuthenticationService(ILinqRepository<User> userRepository, IPasswordHashingService passwordHashingService)
 {
     _passwordHashingService = passwordHashingService;
     _userRepository = userRepository;
 }
        protected override void OnTeardown()
        {
            Repository = null;

            base.OnTeardown();
        }
示例#17
0
        /// <summary>
        /// 构造函数。
        /// </summary>
        /// <param name="dependency">依赖注入。</param>
        /// <param name="users">用户信息。</param>
        /// <param name="linqUsers">用户。</param>
        public ValuesController(IDependency dependency, UserRepository users, ILinqRepository <FeiUsers, int> linqUsers)
        {
            this.dependency = dependency;

            dependency.AopTest();
        }
 public UserService(IHttpContextService context, ILinqRepository<Parent> parentRepository, ILinqRepository<User> userRepository)
 {
     this.context = context;
     this.parentRepository = parentRepository;
     this.userRepository = userRepository;
 }
 public RentalPropertyController(ILinqRepository<RentalProperty> propertyRepository,
    ILinqRepository<User> userRepository)
 {
     _propertyRepository = propertyRepository;
     _userRepository = userRepository;
 }
示例#20
0
 public AgentManagementController(ILinqRepository<Agent> agentRepository,
      ILinqRepository<User> userRepository)
 {
     _agentRepository = agentRepository;
     _userRepository = userRepository;
 }
示例#21
0
 public UserService(IHttpContextService context, ILinqRepository <Parent> parentRepository, ILinqRepository <User> userRepository)
 {
     this.context          = context;
     this.parentRepository = parentRepository;
     this.userRepository   = userRepository;
 }
 /// <summary>
 /// Creates AnnouncementController.
 /// </summary>
 /// <param name="announcementRepository">Announcements repository.</param>
 public AnnouncementsController(ILinqRepository <Announcement> announcementRepository)
 {
     this.announcementRepository = announcementRepository;
     Debug.WriteLine("Created Announcements controller {0:x}", GetHashCode());
 }
示例#23
0
 public TagTasks(ILinqRepository <Tag> tagRepository)
 {
     this.tagRepository = tagRepository;
 }
示例#24
0
 public TagTasks(ILinqRepository<Tag> tagRepository)
 {
     this.tagRepository = tagRepository;
 }
 public CategoryTasks(ILinqRepository<Category> categoryRepository)
 {
     this.categoryRepository = categoryRepository;
 }
示例#26
0
 public UserService(IHttpContextService context, ILinqRepository <Parent, int> parentRepository, ILinqRepository <User, int> userRepository)
 {
     _context          = context;
     _parentRepository = parentRepository;
     _userRepository   = userRepository;
 }
示例#27
0
 public EditAction(ILinqRepository <NugetPackage, long> repository, IMappingEngine mappingEngine)
 {
     _repository    = repository;
     _mappingEngine = mappingEngine;
 }
 /// <summary>
 /// Creates AnnouncementController.
 /// </summary>
 /// <param name="announcementRepository">Announcements repository.</param>
 public AnnouncementsController(ILinqRepository<Announcement> announcementRepository)
 {
     this.announcementRepository = announcementRepository;
     Debug.WriteLine("Created Announcements controller {0:x}", GetHashCode());
 }
 public AuthenticationController(IAuthenticationService authenticationService, ILinqRepository<User> userRepository)
 {
     _authenticationService = authenticationService;
     _userRepository = userRepository;
 }