The recent release of NUnit 3.11 notes on the releases page that:
PlatformAttribute is available on .NET Standard 2.0 and now detects .NET Core
Try using NUnit 3.11.
I also found this page in the NUnit documentation that talks about .NET Standard and .NET Core support. A cursory reading seems to me to suggest it is supported.
UPDATE
With dotnet core Coverlet is your friend. Also see this.
I have moved on to the Cloud and Azure DevOps. Yes, it is just TFS with a lot of lipstick but it is the Cloud. (Psst: GitHub Actions is the future imo).
Here is my Unit Test task (in a yaml pipeline) that runs my NUnit test suite. Essentially it is executing dotnet test
, with which Coverlet is fully integrated.
# UnitTests
- task: DotNetCoreCLI@2
displayName: 'Unit Tests'
inputs:
command: test
projects: '$(APEX_SOLUTION)'
arguments: '--no-restore -c $(BUILD_CONFIGURATION) /p:CollectCoverage=true /p:CoverletOutput=$(Agent.TempDirectory)/ /p:CoverletOutputFormat=opencover /p:Threshold=50 /p:ThresholdType=branch /p:ThresholdStat=Average /p:Exclude="[DevOpsOnboarding.Views]*"'
testRunTitle: 'Unit Tests $(Build.DefinitionName) - $(Build.BuildNumber)'
Coverlet also allows you to produce OpenCover output in one step. After this task I can run ReportGenerator.
Should be straightforward to convert to a Jenkins Batch Step.