Exemplo n.º 1
0
 public UserService(IGuidWrapper guidWrapper, IDateTimeWrapper dateTimeWrapper, IStore <User> userStore, IUserQuery userQuery)
 {
     _guidWrapper     = guidWrapper;
     _dateTimeWrapper = dateTimeWrapper;
     _userStore       = userStore;
     _userQuery       = userQuery;
 }
Exemplo n.º 2
0
 protected AggregatorBase(IRepositoryFactory repositoryFactory, IStatEntityFactory statEntityFactory, IGuidWrapper guid, IDateTimeWrapper dateTime)
 {
     RepositoryFactory = repositoryFactory;
     StatEntityFactory = statEntityFactory;
     GuidWraper = guid;
     DateTimeWrapper = dateTime;
 }
Exemplo n.º 3
0
        public PokemonReader(IDateTimeWrapper dateTimeWrapper, ILogger logger, IPokemonStore pokemonStore)
        {
            _dateTimeWrapper = dateTimeWrapper;
            _logger          = logger;

            _isValidationEnabled = pokemonStore.IsValidationEnabled();
        }
Exemplo n.º 4
0
 public AccountService(AlphaHotelDbContext context, IUserManagerWrapper <User> userManager, IMappingProvider mapper, IDateTimeWrapper dateTime)
 {
     this.context     = context ?? throw new ArgumentNullException(nameof(context));
     this.userManager = userManager ?? throw new ArgumentNullException(nameof(userManager));
     this.mapper      = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.dateTime    = dateTime ?? throw new ArgumentNullException(nameof(dateTime));
 }
 public PlaylistServiceBuilder()
 {
     _dateTimeWrapper    = Substitute.For <IDateTimeWrapper>();
     _mapper             = Substitute.For <IMapper>();
     _playlistRepository = Substitute.For <IPlaylistEntriesRepository>();
     _audioRepository    = Substitute.For <IAudioEntriesRepository>();
 }
Exemplo n.º 6
0
        public OtpTokenStatus GetTokenStatus(string key, string password, string tokenSignature, IDateTimeWrapper dateWrapper)
        {
            #region validate args

            if (String.IsNullOrEmpty(key)) 
                throw new ArgumentException("Argument is null or empty", "key");

            if (String.IsNullOrEmpty(password)) 
                throw new ArgumentException("Argument is null or empty", "password");

            if (String.IsNullOrEmpty(tokenSignature))
                throw new ArgumentException("Argument is null or empty", "tokenSignature");

            #endregion

            try
            {
                var tokenState = _signatureProvider.Parse(tokenSignature);

                if ((tokenState.Key == key) & (tokenState.Password == password))
                    if(tokenState.ExpiryDate > dateWrapper.GetNow())
                        return new OtpTokenStatus(false, tokenSignature, tokenState.ExpiryDate);

                return new OtpTokenStatus(true, tokenSignature, tokenState.ExpiryDate);
            }
            catch (InValidTokenSignatureException)
            {
                return new OtpTokenStatus(true, tokenSignature, new DateTime());
            }

            
        }
Exemplo n.º 7
0
 public BankDetailsServices(IRepository <BankDetails> bankDetailsRepo, IMappingProvider mappingProvider, IDateTimeWrapper dateTime, IRepository <UserBankDetails> userBankDetailsRepo)
 {
     this.userBankDetailsRepo = userBankDetailsRepo;
     this.bankDetailsRepo     = bankDetailsRepo;
     this.mappingProvider     = mappingProvider;
     this.dateTime            = dateTime;
 }
Exemplo n.º 8
0
 public FeedbackService(AlphaHotelDbContext context, IPaginatedList <FeedbackDTO> paginatedList, IDateTimeWrapper dateTime, ICensor censor)
 {
     this.context       = context ?? throw new ArgumentNullException(nameof(context));
     this.paginatedList = paginatedList ?? throw new ArgumentNullException(nameof(paginatedList));
     this.dateTime      = dateTime ?? throw new ArgumentNullException(nameof(dateTime));
     this.censor        = censor ?? throw new ArgumentNullException(nameof(censor));
 }
Exemplo n.º 9
0
 public BusinessService(AlphaHotelDbContext context, IMappingProvider mapper, IDateTimeWrapper dateTime, IPaginatedList <BusinessShortInfoDTO> paginatedList)
 {
     this.context       = context ?? throw new ArgumentNullException(nameof(context));
     this.mapper        = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.dateTime      = dateTime ?? throw new ArgumentNullException(nameof(dateTime));
     this.paginatedList = paginatedList ?? throw new ArgumentNullException(nameof(paginatedList));
 }
Exemplo n.º 10
0
 protected AggregatorBase(IRepositoryFactory repositoryFactory, IStatEntityFactory statEntityFactory, IGuidWrapper guid, IDateTimeWrapper dateTime)
 {
     RepositoryFactory = repositoryFactory;
     StatEntityFactory = statEntityFactory;
     GuidWraper        = guid;
     DateTimeWrapper   = dateTime;
 }
Exemplo n.º 11
0
 public TimerService(IConfigProvider configProvider, IDateTimeWrapper dateTimeWrapper, ILogger <TimerService> logger, ITariffService tariffService)
 {
     _config          = configProvider.Get <TimerConfig>();
     _dateTimeWrapper = dateTimeWrapper;
     _logger          = logger;
     _tariffService   = tariffService;
 }
Exemplo n.º 12
0
        public EntityReader(IDateTimeWrapper dateTimeWrapper, ILogger logger, IDatabase database)
        {
            _dateTimeWrapper = dateTimeWrapper;
            _logger          = logger;

            _isValidationEnabled = database.IsValidationEnabled();
        }
Exemplo n.º 13
0
        public TimeSpanCounter(TimeSpan span, IDateTimeWrapper datetime = null)
        {
            datetime = datetime ?? new DateTimeWrapper();
            if (span.TotalSeconds <= 0)
            {
                throw new ArgumentOutOfRangeException("span", "Timespan must be greated then a minute.");
            }

            this._Span = span.Ticks;

            /*
             * We only want 600 segments of time for a given interval
             * the more segments the more precise the counter
             * Also more segments is more memory being used
             * 600 will use a little more then 9.6 kilobytes per counter
             */
            this._SpanSegment = this._Span / 600;

            this._dateTimeWrapper = datetime;

            var now = _dateTimeWrapper.UtcDateTime.Ticks;

            _CurrentSegment = new TimeSegment(long.MinValue);
            _TimeSegments.Enqueue(_CurrentSegment);
        }
 public StatProjectDeletionService(
     IRepositoryFactory repositoryFactory,
     IStatEntityFactory statEntityFactory,
     IGuidWrapper guid,
     IDateTimeWrapper dateTime)
     : base(repositoryFactory, statEntityFactory, guid, dateTime)
 {
 }
Exemplo n.º 15
0
 public PostUrlFormEncodedService(IResponseContentServiceFactory responseContentServiceFactory,
                                  IHttpClientWrapper httpClient,
                                  IDateTimeWrapper dateTimeWrapper)
 {
     _contentReaderFactory = responseContentServiceFactory;
     _client   = httpClient;
     _dateTime = dateTimeWrapper;
 }
 public StatProjectUploadingService(
     IRepositoryFactory repositoryFactory,
     IStatEntityFactory statEntityFactory,
     IGuidWrapper guid,
     IDateTimeWrapper dateTime)
     : base(repositoryFactory, statEntityFactory, guid, dateTime)
 {
 }
Exemplo n.º 17
0
 public ApiResponseService(IDateTimeWrapper dateTimeWrapper,
                           IHttpClientWrapper httpClientWrapper,
                           IResponseContentServiceFactory responseContentServiceFactory)
 {
     _dateTime = dateTimeWrapper;
     _client   = httpClientWrapper;
     _contentServiceFactory = responseContentServiceFactory;
 }
Exemplo n.º 18
0
        public void SetUp()
        {
            _dateTimeWrapper = Substitute.For <IDateTimeWrapper>();
            _guidWrapper     = Substitute.For <IGuidWrapper>();
            _itemRepository  = Substitute.For <IItemRepository>();

            _itemCreatingService = new ItemCreatingService(_itemRepository, _dateTimeWrapper, _guidWrapper);
        }
Exemplo n.º 19
0
 public StatWatchingService(
     IRepositoryFactory repositoryFactory,
     IStatEntityFactory statEntityFactory,
     IGuidWrapper guid,
     IDateTimeWrapper dateTime)
     : base(repositoryFactory, statEntityFactory, guid, dateTime)
 {
 }
        public void SetUp()
        {
            _dateTimeWrapper      = Substitute.For <IDateTimeWrapper>();
            _itemObtainingService = Substitute.For <IItemObtainingService>();
            _itemRepository       = Substitute.For <IItemRepository>();

            _itemUpdatingService = new ItemUpdatingService(_itemObtainingService, _itemRepository, _dateTimeWrapper);
        }
Exemplo n.º 21
0
 public StatUserRegistrationService(
     IRepositoryFactory repositoryFactory,
     IStatEntityFactory statEntityFactory,
     IGuidWrapper guid,
     IDateTimeWrapper dateTime)
     : base(repositoryFactory, statEntityFactory, guid, dateTime)
 {
 }
Exemplo n.º 22
0
 public TariffService(IConfigProvider configProvider, IDateTimeWrapper dateTimeWrapper, ILogger <TariffService> logger, ITeslaMateRepository repository)
 {
     _dbConfig        = configProvider.Get <DatabaseConfig>();
     _tariffConfig    = configProvider.Get <TariffConfig>();
     _dateTimeWrapper = dateTimeWrapper;
     _logger          = logger;
     _repository      = repository;
 }
 public StatUserRegistrationService(
     IRepositoryFactory repositoryFactory,
     IStatEntityFactory statEntityFactory,
     IGuidWrapper guid,
     IDateTimeWrapper dateTime)
     : base(repositoryFactory, statEntityFactory, guid, dateTime)
 {
 }
Exemplo n.º 24
0
        public AddCommand(IDataProvider dbProvider, IDateTimeWrapper dateTimeWrapper, IParametersParser parametersParser)
        {
            _dbProvider       = dbProvider;
            _dateTimeWrapper  = dateTimeWrapper;
            _parametersParser = parametersParser;

            Type = CommandType.Add;
        }
Exemplo n.º 25
0
 public DataLakeGen2RestApi(IHttpClientWrapper httpClient, IAuthorisation authorisation,
                            IDateTimeWrapper dateTime, string storageAccountName)
 {
     _httpClient         = httpClient;
     _authorisation      = authorisation;
     _dateTime           = dateTime;
     _storageAccountName = storageAccountName;
     _baseUri            = $"https://{_storageAccountName}.dfs.core.windows.net";
 }
Exemplo n.º 26
0
 public AudioServiceBuilder()
 {
     _audioEntriesRepository     = Substitute.For <IAudioEntriesRepository>();
     _dateTimeWrapper            = Substitute.For <IDateTimeWrapper>();
     _localAudioRepository       = Substitute.For <IAudioLocalRepository>();
     _pathProvider               = Substitute.For <IPathProvider>();
     _tagsProvider               = Substitute.For <ITagsProvider>();
     _audioMetaEntriesRepository = Substitute.For <IAudioMetaEntriesRepository>();
 }
 public StatProjectStateService(
     IRepositoryFactory repositoryFactory,
     IStatEntityFactory statEntityFactory,
     IDateTimeWrapper dateTimeWrapper)
 {
     _repositoryFactory = repositoryFactory;
     _statEntityFactory = statEntityFactory;
     _dateTimeWrapper   = dateTimeWrapper;
 }
Exemplo n.º 28
0
 public StatProjectStateService(
     IRepositoryFactory repositoryFactory,
     IStatEntityFactory statEntityFactory,
     IDateTimeWrapper dateTimeWrapper)
 {
     _repositoryFactory = repositoryFactory;
     _statEntityFactory = statEntityFactory;
     _dateTimeWrapper = dateTimeWrapper;
 }
Exemplo n.º 29
0
        public UnitOfWork(IUserService userService,
                          IDateTimeWrapper dateTimeWrapper,
                          TContext dbContext)
        {
            _userService     = userService ?? throw new ArgumentNullException(nameof(userService));
            _dateTimeWrapper = dateTimeWrapper ?? throw new ArgumentNullException(nameof(dateTimeWrapper));

            DbContext = dbContext ?? throw new ArgumentNullException(nameof(dbContext));
        }
Exemplo n.º 30
0
 public PrintInvoiceCommand(
     IDatabase database,
     IPrinter printer,
     IDateTimeWrapper dateTime)
 {
     _database = database;
     _printer  = printer;
     _dateTime = dateTime;
 }
Exemplo n.º 31
0
        public GetCommand(IDataProvider dbProvider, IRandomWrapper randomWrapper, IDateTimeWrapper dateTimeWrapper, IParametersParser parametersParser)
        {
            _dbProvider       = dbProvider;
            _randomWrapper    = randomWrapper;
            _dateTimeWrapper  = dateTimeWrapper;
            _parametersParser = parametersParser;

            Type = CommandType.Get;
        }
Exemplo n.º 32
0
 public LogBookService(AlphaHotelDbContext context, IMappingProvider mapper, IPaginatedList <LogDTO> paginatedList, IDateTimeWrapper dateTime, IUserManagerWrapper <User> userManager, ILogger <LogBookService> logger)
 {
     this.context       = context ?? throw new ArgumentNullException(nameof(context));
     this.mapper        = mapper ?? throw new ArgumentNullException(nameof(mapper));
     this.paginatedList = paginatedList ?? throw new ArgumentNullException(nameof(paginatedList));
     this.dateTime      = dateTime ?? throw new ArgumentNullException(nameof(dateTime));
     this.userManager   = userManager ?? throw new ArgumentNullException(nameof(userManager));
     this.logger        = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemplo n.º 33
0
        public MongoRepository(IResponseBuilderFactory responseBuilderFactory, IDateTimeWrapper dateTimeWrapper)
        {
            _responseBuilderFactory = responseBuilderFactory;
            _dateTimeWrapper        = dateTimeWrapper;

            var mongoClient   = new MongoClient("mongodb://localhost:32771");
            var mongoDatabase = mongoClient.GetDatabase(typeof(TEntity).Name + "Store");

            _mongoCollection = mongoDatabase.GetCollection <TEntity>(typeof(TEntity).Name + "Collection");
        }
 public PlaylistServiceImpl(
     IDateTimeWrapper dateTimeWrapper,
     IMapper mapper,
     IPlaylistEntriesRepository playlistRepository,
     IAudioEntriesRepository audioRepository)
 {
     _dateTimeWrapper    = dateTimeWrapper;
     _mapper             = mapper;
     _playlistRepository = playlistRepository;
     _audioRepository    = audioRepository;
 }
Exemplo n.º 35
0
 public BlogPostService(IBlogPostRepository blogPostRepo,
                        IEntityStringIdGet <Author> authorRepo,
                        IServiceListModelFactory <BlogPostDTO, IEnumerable <BlogPost> > blogSetModelFactory,
                        IServiceModelFactory <BlogPostDTO, BlogPost> blogModelFactory,
                        IDateTimeWrapper dateTimeProvider)
 {
     this.blogPostRepo        = blogPostRepo;
     this.authorRepo          = authorRepo;
     this.blogSetModelFactory = blogSetModelFactory;
     this.blogModelFactory    = blogModelFactory;
     this.dateTimeProvider    = dateTimeProvider;
 }
Exemplo n.º 36
0
 public Account(decimal amount = 0, IDateTimeWrapper dateTimeWrapper = null)
 {
     Balance    = amount;
     Operations = new List <Operation>();
     if (dateTimeWrapper != null)
     {
         DateTimeWrapper = dateTimeWrapper;
     }
     else
     {
         DateTimeWrapper = new DateTimeWrapper();
     }
 }
Exemplo n.º 37
0
 private void ConfigureApi()
 {
     _apiConfig = new ApiConfiguration();
     _otpGenerator = _apiConfig.ConfigureApi();
     _dateTimeWrapper = _apiConfig.GetInstance();
 }
Exemplo n.º 38
0
 public EncodeWebClient(IRestHelper restHelper, IDateTimeWrapper dateTimeWrapper)
 {
     _restHelper = restHelper;
     _dateTimeWrapper = dateTimeWrapper;
 }