コード例 #1
0
ファイル: UserService.cs プロジェクト: leizhe/SoulVoice.API
 public UserService(IUserQueryRepository userQueryRepository,
                    IUserCommandRepository userCommandRepository
                    )
 {
     _userQuery   = userQueryRepository;
     _userCommand = userCommandRepository;
 }
コード例 #2
0
        public async Task Should_not_get_user_Repository_error_Should_return_repository_error_message()
        {
            logger.Setup(x => x.Log(
                             It.IsAny <LogLevel>(),
                             It.IsAny <EventId>(),
                             It.IsAny <It.IsAnyType>(),
                             It.IsAny <Exception>(),
                             (Func <It.IsAnyType, Exception, string>)It.IsAny <object>())).Throws(new System.Exception(""));

            // Arrange
            const string USERDOCUMENT = "32893956858";

            usuarioQueryService = new UserQueryRepository(new InMemoryMongoDbContext(true), logger.Object);

            // Act
            GetUserByDocumentResponse user = await usuarioQueryService.GetUserByDocumentAsync(USERDOCUMENT);

            // Assert
            logger.Verify(x => x.Log(
                              It.IsAny <LogLevel>(),
                              It.IsAny <EventId>(),
                              It.IsAny <It.IsAnyType>(),
                              It.IsAny <Exception>(),
                              (Func <It.IsAnyType, Exception, string>)It.IsAny <object>()));

            Assert.NotEmpty(user.Errors);
        }
コード例 #3
0
 public UserService(IUnitOfWorks unitOfWorks,
                    IUserRepository userRepository,
                    IUserQueryRepository userQueryRepository,
                    IJwtTokenHelper jwtTokenHelper,
                    IEmailSender emailSender,
                    ISecurityCodesRepository securityCodesRepository,
                    IConfiguration configuration,
                    GlobalSettings globalSettings,
                    IHttpContextAccessor httpContextAccessor,
                    IAddressRepository addressRepository,
                    ISecurityCodeQueryRepository securityCodeQueryRepository,
                    ISmsService smsService,
                    IUserContext userContext)
 {
     _unitOfWorks                 = unitOfWorks;
     _userRepository              = userRepository;
     _userQueryRepository         = userQueryRepository;
     _jwtTokenHelper              = jwtTokenHelper;
     _emailSender                 = emailSender;
     _securityCodesRepository     = securityCodesRepository;
     _configuration               = configuration;
     _globalSettings              = globalSettings;
     _httpContextAccessor         = httpContextAccessor;
     _addressRepository           = addressRepository;
     _securityCodeQueryRepository = securityCodeQueryRepository;
     _smsService  = smsService;
     _userContext = userContext;
 }
コード例 #4
0
 public PostService(IPostRepository postRepository,
                    IPostQueryRepository postQueryRepository,
                    IUnitOfWorks unitOfWorks,
                    IMapper mapper,
                    IUserContext userContext,
                    IUserRepository userRepository,
                    IFileService fileService,
                    IHttpContextAccessor httpContextAccessor,
                    ILikeRepository likeRepository,
                    ILikeQueryRepository likeQueryRepository,
                    GlobalSettings globalSettings,
                    IUserQueryRepository userQueryRepository)
 {
     _postRepository      = postRepository;
     _postQueryRepository = postQueryRepository;
     _unitOfWorks         = unitOfWorks;
     _mapper              = mapper;
     _userContext         = userContext;
     _userRepository      = userRepository;
     _fileService         = fileService;
     _httpContextAccessor = httpContextAccessor;
     _likeRepository      = likeRepository;
     _likeQueryRepository = likeQueryRepository;
     _globalSettings      = globalSettings;
     _userQueryRepository = userQueryRepository;
 }
コード例 #5
0
 public UserService(IUserQueryRepository queryRepository, IUserCommandRepository commandRepository,
                    ISignatureService signatureService) : base(queryRepository, commandRepository)
 {
     _queryRepository   = queryRepository;
     _commandRepository = commandRepository;
     _signatureService  = signatureService;
 }
コード例 #6
0
 public UserContext(
     ILocationFactory locationFactory,
     IPurchaseFactory purchaseFactory,
     IUserQueryRepository userQueryRepository)
 {
     PurchaseFactory     = purchaseFactory;
     LocationFactory     = locationFactory;
     UserQueryRepository = userQueryRepository;
 }
コード例 #7
0
ファイル: TestService.cs プロジェクト: leizhe/SoulVoice.API
 public TestService(IUserQueryRepository userQueryRepository,
                    IUserCommandRepository userCommandRepository,
                    IMapper mapper
                    )
 {
     _userQuery   = userQueryRepository;
     _userCommand = userCommandRepository;
     _mapper      = mapper;
 }
コード例 #8
0
 public UserService(
     IUserRepository userRepository,
     IUserQueryRepository userQueryRepository,
     IIndexService <UserModel> indexService,
     IUnitOfWork unitOfWork)
 {
     this.userRepository      = userRepository;
     this.userQueryRepository = userQueryRepository;
     this.indexService        = indexService;
     this.unitOfWork          = unitOfWork;
 }
コード例 #9
0
        public async Task Should_get_user_With_valid_document_Must_return_user()
        {
            // Arrange
            const string USERDOCUMENT = "32893956858";

            usuarioQueryService = new UserQueryRepository(new InMemoryMongoDbContext(true), logger.Object);

            // Act
            GetUserByDocumentResponse user = await usuarioQueryService.GetUserByDocumentAsync(USERDOCUMENT);

            // Assert
            Assert.Equal(USERDOCUMENT, user.Document);
        }
コード例 #10
0
        public async Task Should_not_get_user_With_valid_document_User_not_found_in_database()
        {
            // Arrange
            const string USERDOCUMENT = "45166568095";

            usuarioQueryService = new UserQueryRepository(new InMemoryMongoDbContext(true), logger.Object);

            // Act
            GetUserByDocumentResponse user = await usuarioQueryService.GetUserByDocumentAsync(USERDOCUMENT);

            // Assert
            Assert.Null(user);
        }
コード例 #11
0
 public LikeService(ILikeRepository likeRepository,
                    ILikeQueryRepository likeQueryRepository,
                    IUserContext userContext,
                    IUserQueryRepository userQueryRepository,
                    IPostQueryRepository postQueryRepository,
                    IUnitOfWorks unitOfWorks)
 {
     _likeRepository      = likeRepository;
     _likeQueryRepository = likeQueryRepository;
     _userContext         = userContext;
     _userQueryRepository = userQueryRepository;
     _postQueryRepository = postQueryRepository;
     _unitOfWorks         = unitOfWorks;
 }
コード例 #12
0
 public AccountService(IMapper mapper,
                       IPermissionQueryRepository permissionQueryRepository,
                       IMenuQueryRepository menuQueryRepository,
                       IUserQueryRepository userQueryRepository,
                       IUserCommandRepository userCommandRepository,
                       IUserRoleCommandRepository userRoleCommandRepository)
 {
     _mapper          = mapper;
     _permissionQuery = permissionQueryRepository;
     _menuQuery       = menuQueryRepository;
     _userQuery       = userQueryRepository;
     _userCommand     = userCommandRepository;
     _userRoleCommand = userRoleCommandRepository;
 }
コード例 #13
0
 public WishService(
     IIndexService <WishModel> indexService,
     IWishRepository wishRepository,
     IWishQueryRepository wishQueryRepository,
     IUserQueryRepository userQueryRepository,
     IProductQueryRepository productQueryRepository,
     IUnitOfWork unitOfWork)
 {
     this.wishRepository         = wishRepository;
     this.indexService           = indexService;
     this.wishQueryRepository    = wishQueryRepository;
     this.userQueryRepository    = userQueryRepository;
     this.productQueryRepository = productQueryRepository;
     this.unitOfWork             = unitOfWork;
 }
コード例 #14
0
 public UserController(IUserQueryRepository userQueryRepository)
 {
     UserQueryRepository = userQueryRepository;
 }
コード例 #15
0
 public UsersController(IUserService userService, IUserQueryRepository userQueryServiceRepository)
 {
     this.userService = userService;
     this.userQueryServiceRepository = userQueryServiceRepository;
 }
コード例 #16
0
 public UserService(IUserCommandRepository command, IUserQueryRepository query, IMapper mapper, IConfiguration configuration) : base(command, query, mapper)
 {
     _configuration = configuration;
 }
コード例 #17
0
 public GetAllEmployeesQueryHandler(IMapper mapper, IUserQueryRepository userQueryRepository)
 {
     this._mapper = mapper;
     this._userQueryRepository = userQueryRepository;
 }
コード例 #18
0
 public UserQueryService(IUserQueryRepository userQueryRepository)
 {
     _userQueryRepository = userQueryRepository;
 }
コード例 #19
0
 public UserService(IUserRepository userRepository, IUserQueryRepository userQueryRepository, ICepApiService cepApiService)
 {
     this.userRepository      = userRepository;
     this.userQueryRepository = userQueryRepository;
     this.cepApiService       = cepApiService;
 }
コード例 #20
0
 public UserController(IUserQueryRepository userQueryRepository, IUserService userService)
 {
     this.userQueryRepository = userQueryRepository;
     this.userService         = userService;
 }