示例#1
0
        public async Task <DisposingFile> GetTestFileAsync(ShareServiceClient service = default, string shareName = default, string directoryName = default, string fileName = default)
        {
            DisposingDirectory test = await GetTestDirectoryAsync(service, shareName, directoryName);

            fileName ??= GetNewFileName();
            ShareFileClient file = InstrumentClient(test.Directory.GetFileClient(fileName));

            return(await DisposingFile.CreateAsync(test, file));
        }
示例#2
0
        public async Task <DisposingDirectory> GetTestDirectoryAsync(ShareServiceClient service = default, string shareName = default, string directoryName = default)
        {
            DisposingShare test = await GetTestShareAsync(service, shareName);

            directoryName ??= GetNewDirectoryName();

            ShareDirectoryClient directory = InstrumentClient(test.Share.GetDirectoryClient(directoryName));

            return(await DisposingDirectory.CreateAsync(test, directory));
        }
示例#3
0
 private DisposingFile(DisposingDirectory test, ShareFileClient file)
 {
     _test = test;
     File  = file;
 }
示例#4
0
            public static async Task <DisposingFile> CreateAsync(DisposingDirectory test, ShareFileClient file)
            {
                await file.CreateAsync(maxSize : Constants.MB);

                return(new DisposingFile(test, file));
            }