コード例 #1
0
        public static async Task OneTimeSetup()
        {
            var lockFileInfo = Directories.TempDirectory.CreateFileInfoInDirectory("test.lock");

            lockFile?.DisposeAndDeleteFile();
            lockFile = await LockedFile.CreateAsync(lockFileInfo, TimeSpan.FromSeconds(60))
                       .ConfigureAwait(false);
        }
コード例 #2
0
        public async Task OneTimeSetup()
        {
            var lockFileInfo = Directories.TempDirectory.CreateFileInfoInDirectory("test.lock");

            try
            {
                lockFileInfo.Delete();
            }
            catch
            {
                // this could happen if the previous run was stopped in the debugger.
            }

            // using this because AppVeyor uses two workers for running the tests.
            this.lockFile?.Dispose();
            this.lockFile = await LockedFile.CreateAsync(lockFileInfo, TimeSpan.FromSeconds(60))
                            .ConfigureAwait(false);
        }