Dotnet publish tests
This commit is contained in:
parent
cd357cb273
commit
07eb7ef28f
43 changed files with 1826 additions and 129 deletions
49
test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs
Normal file
49
test/Microsoft.DotNet.Tools.Tests.Utilities/TestBase.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Base class for all unit test classes.
|
||||
/// </summary>
|
||||
public abstract class TestBase : IDisposable
|
||||
{
|
||||
private TempRoot _temp;
|
||||
|
||||
protected TestBase()
|
||||
{
|
||||
}
|
||||
|
||||
public static string GetUniqueName()
|
||||
{
|
||||
return Guid.NewGuid().ToString("D");
|
||||
}
|
||||
|
||||
public TempRoot Temp
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_temp == null)
|
||||
{
|
||||
_temp = new TempRoot();
|
||||
}
|
||||
|
||||
return _temp;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (_temp != null)
|
||||
{
|
||||
_temp.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue