2017-12-04 20 views
0
**\*test*.dll 

난 후에 .NET CLI에이 스키마를 사용하려면 실행하지만, 프로젝트 파일의 구조가 이런 식으로 this입니다 아무것도 아냐 난 후에 .NET 시험 문서를 찾을 수 없습니다.DOTNET CLI 구축하고 테스트 - 단지 시험

현재 테스트에서는 .sln 파일 아래의 모든 .dll 파일을 검사합니다. 하지만 난 그냥 tests.dll 파일을

dotnet test --no-build "**\*test*.dll" //?? All files in my project 

답변

0

이 링크를 참조하십시오, 그 후에 .NET 테스트를 위해, 우리는 표시 이름 또는 xUnit의에 대한 FullyQualifiedName에 의해 테스트를 필터링 할 수 있습니다 필터링하는 등의 패턴이되지 찾고 원하는 dertails : https://github.com/Microsoft/vstest-docs/blob/master/docs/filter.md

그러나 테스트 만 필터링 할 수 있으며 다른 테스트 프로젝트가 아닌 .dll을 제외 할 수 없습니다.

dotnet test --filter "FullyQualifiedName=YourNamespace.TestClass1.Test1" 

어떻게하면 PowerShell 스크립트를 작성하여 테스트 프로젝트를 필터링하고 루프에서 명령을 실행할 수 있습니다. 참조 : Dotnet CLI – running tests from multiple assemblies

또한

Get-ChildItem | ? { $_.Name.Contains("Test") } | ForEach-Object { Push-Location; Set-Location $_.Name; dotnet test --no-build; Pop-Location} 

참조 용 스레드 : https://github.com/Microsoft/vstest/issues/705


다른 해결 방법은 테스트 프로젝트를 실행하기 위해 cmd를/박쥐에게 스크립트를 작성한다 :

예를

cd C:\TestProjectPath\A.Tests 

dotnet test --no-build 

cd C:\TestProjectPath\B.Tests 

dotnet test --no-build 

cd C:\TestProjectPath\C.Tests 

dotnet test --no-build