2016-10-28 01:46:43 +00:00
|
|
|
|
// 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
|
|
|
|
|
{
|
2016-11-09 07:23:13 +00:00
|
|
|
|
public static partial class FileInfoExtensions
|
2016-10-28 01:46:43 +00:00
|
|
|
|
{
|
|
|
|
|
public static FileInfoAssertions Should(this FileInfo file)
|
|
|
|
|
{
|
|
|
|
|
return new FileInfoAssertions(file);
|
|
|
|
|
}
|
|
|
|
|
|
2016-11-09 07:23:13 +00:00
|
|
|
|
public static IDisposable Lock(this FileInfo subject)
|
2016-10-28 01:46:43 +00:00
|
|
|
|
{
|
2016-11-09 07:23:13 +00:00
|
|
|
|
return new FileInfoLock(subject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IDisposable NuGetLock(this FileInfo subject)
|
|
|
|
|
{
|
|
|
|
|
return new FileInfoNuGetLock(subject);
|
2016-10-28 01:46:43 +00:00
|
|
|
|
}
|
2017-01-06 09:40:26 +00:00
|
|
|
|
|
|
|
|
|
public static string ReadAllText(this FileInfo subject)
|
|
|
|
|
{
|
|
|
|
|
return File.ReadAllText(subject.FullName);
|
|
|
|
|
}
|
2016-10-28 01:46:43 +00:00
|
|
|
|
}
|
|
|
|
|
}
|