Пример #1
0
        private async Task VerifyQuota(Context context, TestFileSystemContentStoreInternal store, Action <MaxSizeQuota> verify)
        {
            // Sync to allow calibration to occur.
            await store.SyncAsync(context);

            var currentQuota = await LoadElasticQuotaAsync(store.RootPathForTest);

            Assert.NotNull(currentQuota);
            verify(currentQuota.Quota);
        }
Пример #2
0
        private async Task PlaceFileHardLinkToLongFilePathAsync(
            TestFileSystemContentStoreInternal store,
            Context context,
            DisposableDirectory tempDirectory,
            ContentHash hash,
            int length,
            bool shouldError)
        {
            AbsolutePath placePath = FileSystem.MakeLongPath(tempDirectory.Path, length);

            var result = await store.PlaceFileAsync(
                context, hash, placePath, FileAccessMode.ReadOnly, FileReplacementMode.FailIfExists, FileRealizationMode.HardLink, null);

            result.Code.Should().Be(shouldError ? PlaceFileResult.ResultCode.Error : PlaceFileResult.ResultCode.PlacedWithHardLink, result.ToString());
        }