[WIP] Removes *3 verbs, making msbuild the driver (#4456)
Removes *3 verbs, making msbuild the driver
This commit is contained in:
parent
55c59d621e
commit
6fcbefa4f7
746 changed files with 4256 additions and 32434 deletions
|
@ -0,0 +1,55 @@
|
|||
// 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);
|
||||
}
|
||||
|
||||
public AndWhichConstraint<FileInfoAssertions, DateTimeOffset> HaveLastWriteTimeUtc(string because = "", params object[] reasonArgs)
|
||||
{
|
||||
var lastWriteTimeUtc = _fileInfo.LastWriteTimeUtc;
|
||||
|
||||
Execute.Assertion
|
||||
.ForCondition(lastWriteTimeUtc != null)
|
||||
.BecauseOf(because, reasonArgs)
|
||||
.FailWith($"Expected File {_fileInfo.FullName} to have a LastWriteTimeUTC, but it is null.");
|
||||
return new AndWhichConstraint<FileInfoAssertions, DateTimeOffset>(this, lastWriteTimeUtc);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue