Beispiel #1
0
        public BucketSizeCheck(IHttpClientFactory httpClientFactory, CouchbaseBucketSizeSettings settings)
        {
            if (settings == null || settings.AreBasicSettingsEmpty)
            {
                throw new ArgumentException(nameof(settings));
            }

            _httpClientFactory = httpClientFactory;
            _settings          = settings;
        }
        public ICheck ToCheck()
        {
            var settings = new CouchbaseBucketSizeSettings
            {
                ServerUrl  = ServerUrl,
                MaxRecords = MaxRecords
            };

            if (!string.IsNullOrEmpty(PoolName))
            {
                settings.PoolName = PoolName;
            }

            if (!string.IsNullOrEmpty(BucketName))
            {
                settings.BucketName = BucketName;
            }

            return(new BucketSizeCheck(new AuthorizedHttpClientFactory(Credentials), settings));
        }