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)); }
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)); }
private DisposingFile(DisposingDirectory test, ShareFileClient file) { _test = test; File = file; }
public static async Task <DisposingFile> CreateAsync(DisposingDirectory test, ShareFileClient file) { await file.CreateAsync(maxSize : Constants.MB); return(new DisposingFile(test, file)); }