dotnet-installer/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/FileInfoExtensions.cs
Piotr Puszkiewicz bf4588b6fc Add PJ support to TestAssets (#5109)
* Add PJ support to TestAssets

* Cleaning the test assets is hard, so throwing instead

* better assets filter

* PR feedback

* PR Feedback

* Fix NullRef

* Move lock to surround action + file read/write
2017-01-06 01:40:26 -08:00

34 lines
953 B
C#

// 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.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public static partial class FileInfoExtensions
{
public static FileInfoAssertions Should(this FileInfo file)
{
return new FileInfoAssertions(file);
}
public static IDisposable Lock(this FileInfo subject)
{
return new FileInfoLock(subject);
}
public static IDisposable NuGetLock(this FileInfo subject)
{
return new FileInfoNuGetLock(subject);
}
public static string ReadAllText(this FileInfo subject)
{
return File.ReadAllText(subject.FullName);
}
}
}