dotnet-installer/test/Microsoft.DotNet.Tools.Tests.Utilities/Assertions/FileInfoAssertions.cs
dotnet-maestro[bot] f8eb583d40
[master] Update dependencies from dotnet/arcade (#8726)
* Update dependencies from https://github.com/dotnet/arcade build 20200924.4

Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20474.4

Dependency coherency updates

Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
 From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk

* Update dependencies from https://github.com/dotnet/arcade build 20200928.3

Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20478.3

Dependency coherency updates

Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks
 From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk

* Update dependencies from https://github.com/dotnet/arcade build 20201006.7

Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 5.0.0-beta.20471.1 -> To Version 5.0.0-beta.20506.7

Dependency coherency updates

Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
 From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk

* Update dependencies from https://github.com/dotnet/arcade build 20201009.12

Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20509.12

Dependency coherency updates

Microsoft.WindowsDesktop.App.Ref,Microsoft.WindowsDesktop.App,Microsoft.AspNetCore.App.Ref,Microsoft.AspNetCore.App.Ref.Internal,Microsoft.AspNetCore.App.Runtime.win-x64,VS.Redist.Common.AspNetCore.TargetingPack.x64.5.0,dotnet-dev-certs,dotnet-user-secrets,dotnet-watch,Microsoft.Dotnet.WinForms.ProjectTemplates,Microsoft.WindowsDesktop.App.Runtime.win-x64,Microsoft.DotNet.Wpf.ProjectTemplates,Microsoft.FSharp.Compiler,Microsoft.NET.Test.Sdk,Microsoft.NET.ILLink.Tasks,Microsoft.Net.Compilers.Toolset,Microsoft.Build,NuGet.Build.Tasks,Microsoft.SourceLink.GitHub,XliffTasks
 From Version 5.0.0-rc.2.20474.5 -> To Version 5.0.0-rc.1.20417.4 (parent: Microsoft.NET.Sdk

* Update dependencies from https://github.com/dotnet/arcade build 20201020.8

Microsoft.DotNet.Build.Tasks.Installers , Microsoft.DotNet.Arcade.Sdk
 From Version 5.0.0-beta.20471.1 -> To Version 6.0.0-beta.20520.8

Dependency coherency updates

Microsoft.SourceLink.GitHub,XliffTasks
 From Version 1.1.0-beta-20464-02 -> To Version 1.1.0-beta-20519-02 (parent: Microsoft.DotNet.Arcade.Sdk

* Update FileInfoAssertions.cs

* Update FileInfoAssertions.cs

* Use tasks provided by Microsoft.DotNet.Build.Tasks.Installers when provided.

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
Co-authored-by: Viktor Hofer <viktor.hofer@microsoft.com>
Co-authored-by: Jeremy Koritzinsky <jekoritz@microsoft.com>
2020-10-23 09:44:02 +02:00

44 lines
1.5 KiB
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 FluentAssertions;
using FluentAssertions.Execution;
using Microsoft.DotNet.Cli.Utils;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public class FileInfoAssertions
{
private FileInfo _fileInfo;
public FileInfoAssertions(FileInfo file)
{
_fileInfo = file;
}
public FileInfo FileInfo => _fileInfo;
public AndConstraint<FileInfoAssertions> Exist(string because = "", params object[] reasonArgs)
{
Execute.Assertion
.ForCondition(_fileInfo.Exists)
.BecauseOf(because, reasonArgs)
.FailWith($"Expected File {_fileInfo.FullName} to exist, but it does not.");
return new AndConstraint<FileInfoAssertions>(this);
}
public AndConstraint<FileInfoAssertions> NotExist(string because = "", params object[] reasonArgs)
{
Execute.Assertion
.ForCondition(!_fileInfo.Exists)
.BecauseOf(because, reasonArgs)
.FailWith($"Expected File {_fileInfo.FullName} to not exist, but it does.");
return new AndConstraint<FileInfoAssertions>(this);
}
}
}