Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions ExpectedExceptionExample/ExpectedExceptionExample.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProjectType>Local</ProjectType>
Expand Down Expand Up @@ -70,8 +70,13 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>packages\NUnit.3.0.0\lib\net20\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.4.1\lib\net20\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NUnit.System.Linq, Version=0.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.4.1\lib\net20\NUnit.System.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System">
<Name>System</Name>
Expand Down
7 changes: 4 additions & 3 deletions ExpectedExceptionExample/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.0.0" targetFramework="net20" />
</packages>
<package id="NUnit" version="3.4.1" targetFramework="net20" />
<package id="NUnit.ConsoleRunner" version="3.4.1" targetFramework="net20" />
</packages>
19 changes: 5 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@
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).

***
Build using AppVeyor's Online CI:
Example branching only: **topic**

[![Build status](https://ci.appveyor.com/api/projects/status/1n2pyp8otedkeebq?svg=true)](https://ci.appveyor.com/project/munderseth/csharp-nunit)

***
Publishing **Test Content** using www.testspace.com.

[![Space Health](https://samples.testspace.com/projects/168/spaces/822/badge)](https://samples.testspace.com/projects/168/spaces/822 "Test Cases")
[![Space Metric](https://samples.testspace.com/projects/168/spaces/822/metrics/805/badge)](https://samples.testspace.com/spaces/822/schema/Code%20Coverage "Code Coverage (branches)")
[![Space Metric](https://samples.testspace.com/projects/168/spaces/822/metrics/806/badge)](https://samples.testspace.com/spaces/822/schema/Code%20Coverage "Code Coverage (methods)")
[![Space Metric](https://samples.testspace.com/projects/168/spaces/822/metrics/808/badge)](https://samples.testspace.com/spaces/822/schema/Static%20Analysis "Static Analysis (issues)")
* Reference article: [git branching workflow](https://git-scm.com/book/en/v1/Git-Branching-Branching-Workflows)

***

Expand All @@ -39,15 +31,14 @@ Pushing Content using **Testspace client**:
<pre>
curl -fsS -o testspace-windows.zip https://testspace-client.s3.amazonaws.com/testspace-windows.zip
7z x -y .\testspace-windows.zip
testspace @.testspace.txt %TESTSPACE_TOKEN%/testspace-samples:csharp.nunit/%APPVEYOR_REPO_BRANCH%#appveyor.build.%APPVEYOR_BUILD_NUMBER%
testspace analysis.xml [Tests]TestResult.xml coverage.xml %TESTSPACE_TOKEN%/%APPVEYOR_REPO_NAME:/=:%/%APPVEYOR_REPO_BRANCH%#appveyor.build.%APPVEYOR_BUILD_NUMBER%
</pre>

Checkout the published [Testspace Content](https://samples.testspace.com/projects/csharp.nunit). Note that the `.testspace.txt` file contains the [set of files](http://help.testspace.com/how-to:publish-content#publishing-via-content-list-file) to publish.
Checkout the published [Testspace Content](https://samples.testspace.com/projects/csharp.nunit). Note that the `.testspace.txt` file contains the [set of files](http://help.testspace.com/how-to:publish-content#publishing-via-content-list-file) to publish.

To replicate this sample:
To replicate this sample:
- Setup account at www.testspace.com.
- Create a Environment variable called `TESTSPACE_TOKEN`
- `TESTSPACE_TOKEN` = `credentials@Your-Org-Name.testspace.com`
- `credentials` set to `username:password` or your [access token](http://help.testspace.com/reference:client-reference#login-credentials)
- To [use Testspace with a CI system](http://help.testspace.com/how-to:add-to-ci-workflow), store `TESTSPACE_TOKEN` as a secure environment variable

8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ configuration: Debug

build_script:
- nuget restore money/cs-money.sln

test_script:
- msbuild money/cs-money.csproj /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:runCodeAnalysis=true /p:codeanalysislogfile=..\analysis.xml
- .\money\packages\OpenCover.4.6.519\tools\OpenCover.Console -target:".\money\packages\NUnit.ConsoleRunner.3.2.1\tools\nunit3-console.exe" -targetargs:"money\bin\Debug\cs-money.dll" -output:"coverage.xml" -filter:"+[*]* -[*]*MoneyTest*" -register:user
- .\money\packages\OpenCover.4.6.519\tools\OpenCover.Console -target:".\money\packages\NUnit.ConsoleRunner.3.4.1\tools\nunit3-console.exe" -targetargs:"money\bin\Debug\cs-money.dll" -output:"coverage.xml" -filter:"+[*]* -[*]*MoneyTest*" -register:user

after_test:
- curl -fsS -o testspace-windows.zip https://testspace-client.s3.amazonaws.com/testspace-windows.zip
- curl -fsS -o testspace-windows.zip https://testspace-client.s3.amazonaws.com/testspace-windows.zip
- 7z x -y testspace-windows.zip
- testspace @.testspace.txt %TESTSPACE_TOKEN%/testspace-samples:csharp.nunit/%APPVEYOR_REPO_BRANCH%#appveyor.build.%APPVEYOR_BUILD_NUMBER%
- testspace analysis.xml [Tests]TestResult.xml coverage.xml %TESTSPACE_TOKEN%/%APPVEYOR_REPO_NAME:/=:%/%APPVEYOR_REPO_BRANCH%#appveyor.build.%APPVEYOR_BUILD_NUMBER%
8 changes: 6 additions & 2 deletions money/cs-money.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework, Version=3.2.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.2.1\lib\net20\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.4.1\lib\net20\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NUnit.System.Linq, Version=0.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.4.1\lib\net20\NUnit.System.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System">
Expand Down
11 changes: 3 additions & 8 deletions money/packages.config
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.2.1" targetFramework="net20" />
<package id="NUnit.ConsoleRunner" version="3.2.1" targetFramework="net20" />
<package id="NUnit.Extension.NUnitProjectLoader" version="3.2.1" targetFramework="net20" />
<package id="NUnit.Extension.NUnitV2Driver" version="3.2.1" targetFramework="net20" />
<package id="NUnit.Extension.NUnitV2ResultWriter" version="3.2.1" targetFramework="net20" />
<package id="NUnit.Extension.VSProjectLoader" version="3.2.1" targetFramework="net20" />
<package id="NUnit.Runners" version="3.2.1" targetFramework="net20" />
<package id="NUnit" version="3.4.1" targetFramework="net20" />
<package id="NUnit.ConsoleRunner" version="3.4.1" targetFramework="net20" />
<package id="OpenCover" version="4.6.519" targetFramework="net20" />
</packages>
</packages>
11 changes: 8 additions & 3 deletions syntax/cs-syntax.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
<PropertyGroup>
<ProjectType>Local</ProjectType>
Expand Down Expand Up @@ -70,8 +70,13 @@
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>packages\NUnit.3.0.0\lib\net20\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.4.1.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.4.1\lib\net20\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NUnit.System.Linq, Version=0.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>packages\NUnit.3.4.1\lib\net20\NUnit.System.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System">
<Name>System</Name>
Expand Down
5 changes: 3 additions & 2 deletions syntax/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="3.2.0" targetFramework="net20" />
<package id="NUnit" version="3.4.1" targetFramework="net20" />
<package id="NUnit.ConsoleRunner" version="3.4.1" targetFramework="net20" />
</packages>