예제 #1
0
        public async Task WhenCollectionIsUpScaled_AndAutomaticScalingIsTurnedOff_ThenOfferDoesNotChange()
        {
            var catStore     = new CosmosStore <Cat>(new CosmosStoreSettings(_databaseId, _emulatorUri, _emulatorKey), _collectionName);
            var cosmosScaler = new CosmosScaler <Cat>(catStore);

            await cosmosScaler.UpscaleCollectionRequestUnitsForRequest(_databaseId, _collectionName, 100, 5);

            var offer = await catStore.CosmonautClient.GetOfferV2ForCollectionAsync(_databaseId, _collectionName);

            offer.Content.OfferThroughput.Should().Be(400);
        }
예제 #2
0
        public async Task WhenCollectionIsUpScaled_AndAutomaticScalingIsTurnedOn_ThenOfferIsUpscaled()
        {
            var catStore = new CosmosStore <Cat>(new CosmosStoreSettings(_databaseId, _emulatorUri, _emulatorKey,
                                                                         settings =>
            {
                settings.DefaultCollectionThroughput     = 500;
                settings.ScaleCollectionRUsAutomatically = true;
            }), _collectionName);
            var cosmosScaler = new CosmosScaler <Cat>(catStore);

            await cosmosScaler.UpscaleCollectionRequestUnitsForRequest(_databaseId, _collectionName, 100, 5);

            var offer = await catStore.CosmonautClient.GetOfferV2ForCollectionAsync(_databaseId, _collectionName);

            offer.Content.OfferThroughput.Should().Be(500);
        }