每当我们传递一个向Assert.Throws抛出异常的本地函数时,歧义调用就会在Assert.Throws(Action)和'Assert.Throws(Func)之间发生。
该错误不是在本地发生,而是在我们运行构建管道时发生。
可以回购:
void iut() => throw new NotImplementedException();
Assert<NotImplentedException>(iut);
以下是管道的Yaml:
trigger:
- master
pool:
vmImage: 'Ubuntu-16.04'
variables:
buildConfiguration: 'Release'
steps:
- task: DotNetCoreCLI@2
displayName: 'dotnet restore'
inputs:
command: restore
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'dotnet build'
inputs:
projects: '**/*.csproj'
- task: DotNetCoreCLI@2
displayName: 'dotnet test'
inputs:
command: test
projects: '**/*.Tests.csproj'
- task: PublishBuildArtifacts@1
displayName: 'Publish Artifact: drop'