Comments on: Code Coverage in .NET https://code-maze.com/dotnet-code-coverage/ Learn. Code. Succeed. Sun, 28 Apr 2024 12:41:32 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: Siby TP https://code-maze.com/dotnet-code-coverage/#comment-7251 Wed, 28 Dec 2022 09:28:25 +0000 https://code-maze.com/?p=59009#comment-7251 please use the comment as dotnet test –collect:“XPlat Code Coverage”

]]>
By: quintos https://code-maze.com/dotnet-code-coverage/#comment-4535 Mon, 18 Oct 2021 14:02:49 +0000 https://code-maze.com/?p=59009#comment-4535 Great article! I had following the article to set up a CI in my git repo, and there is some difference to the article’s configuration. First, the default working directory will error in my workflow, so I removed the step.
secondly, the Codecov action’s version in GitHub currently was 2.x, I had not found the 1.x. And I found that you should authorize Codecov to access your GitHub repo, if not do this, the Codecov will run a 404 token error.

the following code is my repo’s config, it works for my repo:
dengyakui/CodeCoverDemo: demo for code coverage (github.com)

name: .NET
	

	on:
	  push:
	    branches: [ main ]
	  pull_request:
	    branches: [ main ]
	

	jobs:
	  build:
	    runs-on: ubuntu-latest
	    steps:
	    - uses: actions/checkout@v2
	    - name: Setup .NET
	      uses: actions/setup-dotnet@v1
	      with:
	        dotnet-version: 5.0.x
	    - name: Restore dependencies
	      run: dotnet restore
	    - name: Build
	      run: dotnet build --no-restore
	    - name: Test
	      run: dotnet test --no-build --verbosity normal --collect "XPlat Code Coverage"
	    - name: Codecov
	      uses: codecov/[email protected]
]]>
By: Marinko Spasojević https://code-maze.com/dotnet-code-coverage/#comment-4445 Tue, 05 Oct 2021 09:29:15 +0000 https://code-maze.com/?p=59009#comment-4445 In reply to Branislav Petrović.

Thank you very much, Branislav. You are correct, that’s the obvious typo. I’ve fixed it now.

]]>
By: Branislav Petrović https://code-maze.com/dotnet-code-coverage/#comment-4444 Tue, 05 Oct 2021 09:22:16 +0000 https://code-maze.com/?p=59009#comment-4444 Great article! Simple explanation of unit testing and code coverage in .NET.

I think there is a typo in this sentence: “Let’s add a project reference from our test project to our class library, then add a using statement to UnitTest1.cs”. Instead it should be written: “Let’s add a project reference from our class library to our test project, then add a using statement to UnitTest1.cs”

Thanks.

]]>