// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.IO; namespace Microsoft.NuGet.Build.Tasks.Tests.Helpers { public sealed class DisposableDirectory : TempDirectory, IDisposable { public DisposableDirectory(TempRoot root) : base(root) { } public void Dispose() { if (Path != null && Directory.Exists(Path)) { Directory.Delete(Path, recursive: true); } } } }