Example #1
0
        public void Initialize()
        {
            _certificateExpirationTime = DateTimeOffset.UtcNow.AddHours(24).TruncateToSeconds();
            _certificateRefreshTime    = DateTimeOffset.UtcNow.AddHours(18).TruncateToSeconds();
            _testStartTime             = DateTimeOffset.UtcNow;

            _config         = new DefaultConfig().Value();
            _authKeyManager = new MockOfAuthKeyManager();
            _apiClient      = Substitute.For <IApiClient>();
            _apiClient.RequestAuthCertificateAsync(Arg.Any <CertificateRequestData>())
            .Returns(async(args) => await MockOfRequestAuthCertificateAsync(args.Arg <CertificateRequestData>()));
            _appSettings        = Substitute.For <IAppSettings>();
            _logger             = Substitute.For <ILogger>();
            _eventAggregator    = Substitute.For <IEventAggregator>();
            _certificateManager = new AuthCertificateManager(_config, _authKeyManager, _apiClient, _appSettings, _logger, _eventAggregator);
        }
Example #2
0
        public void Cleanup()
        {
            _config             = null;
            _authKeyManager     = null;
            _apiClient          = null;
            _appSettings        = null;
            _eventAggregator    = null;
            _logger             = null;
            _certificateManager = null;

            _certificateExpirationTime = null;
            _certificateRefreshTime    = null;
            _testStartTime             = null;
            _testEndTime             = null;
            _certificateResponseData = null;
            _usedClientPublicKeys    = null;
        }