|
3 | 3 |
|
4 | 4 | ## C#/NUnit sample for demonstrating Testspace |
5 | 5 |
|
6 | | -This is a sample for the use of the [NUnit](http://nunit.org/) test framework using C# [examples](https://github.com/nunit/nunit-csharp-samples). It is used to demonstrate Testspace usage models for easier test content management. |
| 6 | +This sample demonstrates techniques for using Testspace with C# code and the [NUnit](http://nunit.org/) test framework, along with the [OpenCover](https://github.com/OpenCover/opencover) coverage tool and [Visual Studio's](https://msdn.microsoft.com/en-us/library/dd264939.aspx) static analysis tool using [NUnit's C# examples](https://github.com/nunit/nunit-csharp-samples). |
| 7 | + |
| 8 | +*** |
| 9 | +Build using AppVeyor's Online CI: |
7 | 10 |
|
8 | 11 | [](https://ci.appveyor.com/project/jeffs-s2/csharp-nunit) |
9 | | -[](https://samples.testspace.com/projects/94/spaces/343 "Test Cases") |
10 | | -[](https://samples.testspace.com/spaces/343/schema/coverage "Branch/Condition Coverage") |
11 | | -[](https://samples.testspace.com/spaces/343/schema/coverage "Function/Method Coverage") |
12 | | -[](https://samples.testspace.com/spaces/343/schema/coverage "Line/Statement Coverage") |
| 12 | +*** |
| 13 | +Publishing **Test Content** using www.testspace.com. |
13 | 14 |
|
| 15 | +[](https://samples.testspace.com/projects/94/spaces/343 "Test Cases") |
| 16 | +[](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (branches)") |
| 17 | +[](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (methods)") |
| 18 | +[](https://samples.testspace.com/spaces/343/schema/Code%20Coverage "Code Coverage (sequences)") |
| 19 | +[](https://samples.testspace.com/spaces/343/schema/Static%20Analysis "Static Analysis (issues)") |
14 | 20 | *** |
15 | 21 |
|
16 | | -We have made a few minor modifications to to original samples for reporting purposes. In order to run this sample you will need a host workstation with Visual Studio, the [Nunit](http://nunit.org/) test framework and the [OpenCover](https://github.com/OpenCover/opencover) coverage tool. |
| 22 | +In order to run this sample you will need a host workstation with Visual Studio, the [Nunit](http://nunit.org/) test framework and the [OpenCover](https://github.com/OpenCover/opencover) coverage tool. |
| 23 | + |
| 24 | +Building with static analysis: |
17 | 25 |
|
18 | | -Publishing results example: |
| 26 | +<pre> |
| 27 | +msbuild money/cs-money.csproj /p:runCodeAnalysis=true /p:codeanalysislogfile=StaticAnalysis.xml |
| 28 | +</pre> |
| 29 | +Running tests with code coverage: |
19 | 30 |
|
20 | 31 | <pre> |
21 | 32 | OpenCover.Console.exe -target:nunit3-console.exe -targetargs:cs-money.dll -output:codecoverage.xml -register:user |
22 | 33 |
|
23 | | -testspace publish TestResult.xml codecoverage.xml |
| 34 | +</pre> |
| 35 | + |
| 36 | +Publishing Results using **Testspace** in powershell: |
| 37 | + |
| 38 | +<pre> |
| 39 | +wget https://testspace-client.s3.amazonaws.com/testspace-windows.zip -outfile .\money\packages\testspace.zip |
| 40 | +extract to preferred location |
| 41 | +testspace .\testresult.xml .\coverage.xml money\staticanalysis.xml ${ENV:TESTSPACE_TOKEN}/${ENV:BRANCH_NAME} |
24 | 42 | </pre> |
25 | 43 |
|
26 | 44 | Checkout the [Space](https://samples.testspace.com/projects/csharp/spaces/nunit). |
|
0 commit comments