├── .github
└── workflows
│ └── test-action.yml
├── .gitignore
├── LICENSE
├── NOTES.md
├── README.md
├── Step-GitVersionTag.md
├── Step-GitVersionTag.ps1
├── _init
└── index.js
├── action.ps1
├── action.yml
├── action_helpers.ps1
├── build.ps1
├── docs
├── sample-badges1.png
├── sample-badges2.png
├── sample-checkrun-report1.png
├── sample-checkrun-report2.png
├── sample-checkrun-report3.png
├── sample-failure1.png
└── sample-gist-report1.png
├── invoke-pwsh.js
├── package-lock.json
├── package.json
├── tests
├── nunit-csharp-samples
│ ├── README.md
│ └── syntax
│ │ ├── AssertSyntaxTests.cs
│ │ └── syntax.csproj
├── rafaelfgx_DotNetTests
│ ├── Data
│ │ ├── Calculator
│ │ │ ├── Calculator.cs
│ │ │ └── ICalculator.cs
│ │ ├── Data.csproj
│ │ ├── Data.csproj.ORIG
│ │ └── Entities
│ │ │ ├── Customer.cs
│ │ │ ├── Order.cs
│ │ │ ├── OrderItem.cs
│ │ │ └── Product.cs
│ ├── MSTest
│ │ ├── FakeItEasyTest.cs
│ │ ├── MSTest.csproj
│ │ ├── MSTest.csproj.ORIG
│ │ ├── MoqTest.cs
│ │ ├── NBuilderTest.cs
│ │ ├── NSubstituteTest.cs
│ │ └── RealTest.cs
│ └── README.md
├── samples.xunit
│ ├── AssertExamples
│ │ ├── AssertExamples.csproj
│ │ ├── AssertExamples.csproj.ORIG
│ │ ├── AsyncExamples.cs
│ │ ├── CollectionExample.cs
│ │ └── EqualExample.cs
│ └── README.md
└── tests.sln
└── trx-report
├── sample-test-results.ps1
├── sample-test-results.trx
├── sample-test.results.md
├── trx2md-alt-sample.xsl
├── trx2md.ps1
├── trx2md.xsl
└── vstst-2019.xsd
/.github/workflows/test-action.yml:
--------------------------------------------------------------------------------
1 |
2 | name: test-action
3 |
4 | on:
5 | workflow_dispatch:
6 | inputs:
7 | skip_check_run:
8 | required: false
9 | gist_name:
10 | required: false
11 | set_check_status_from_test_outcome:
12 | required: false
13 | #push:
14 | #release:
15 | # types: published
16 |
17 | jobs:
18 |
19 | run-tests:
20 | strategy:
21 | matrix:
22 | os:
23 | - 'ubuntu-latest'
24 | - 'windows-latest'
25 | runs-on: ${{ matrix.os }}
26 | steps:
27 |
28 | - name: checkout
29 | uses: actions/checkout@v1
30 |
31 | - name: setup dotnet
32 | uses: actions/setup-dotnet@v1
33 | with:
34 | dotnet-version: '5.0.100-preview.7.20366.6'
35 |
36 | - name: use this action, default args (missing solution/project paths)
37 | ## We expect this one to fail
38 | continue-on-error: true
39 | id: testAction1
40 | uses: ./
41 | with:
42 | github_token: ${{ secrets.GITHUB_TOKEN }}
43 |
44 | ## This one does not work as expected because
45 | ## VSTest logs all projects in a solution to
46 | ## the same output file, overwriting the TRX
47 | ## each time, so only the last one wins!
48 | ## https://github.com/microsoft/vstest/issues/2113
49 | ## https://github.com/microsoft/vstest/issues/880
50 | - name: use this action, test solution dir
51 | if: ${{ !cancelled() }}
52 | id: testAction2
53 | uses: ./
54 | with:
55 | project_path: tests
56 | report_name: tests_0_all_in_solution-${{ matrix.os }}
57 | report_title: All Tests In Solution -- Last Project Wins!
58 | github_token: ${{ secrets.GITHUB_TOKEN }}
59 |
60 | - name: use this action, xunit project dir
61 | if: ${{ !cancelled() }}
62 | id: testAction3a
63 | uses: ./
64 | with:
65 | project_path: tests/samples.xunit/AssertExamples
66 | report_name: tests_1_xunit-${{ matrix.os }}
67 | report_title: Sample XUnit Tests (${{ matrix.os }})
68 | github_token: ${{ secrets.GITHUB_TOKEN }}
69 | gist_name: dotnet-tests-report_xunit-${{ matrix.os }}.md
70 | gist_badge_label: 'XUnit Tests: %Counters_passed%/%Counters_total%'
71 | gist_token: ${{ secrets.GIST_TOKEN }}
72 |
73 | - name: use this action, xunit project dir no restore no build
74 | if: ${{ !cancelled() }}
75 | id: testAction3a1
76 | uses: ./
77 | with:
78 | project_path: tests/samples.xunit/AssertExamples
79 | report_name: tests_1_xunit-norestore-nobuild-${{ matrix.os }}
80 | report_title: Sample XUnit Tests without build or restore (${{ matrix.os }})
81 | github_token: ${{ secrets.GITHUB_TOKEN }}
82 | no_restore: true
83 | no_build: true
84 |
85 | - name: use this action, xunit project dir, ALTERNATE XSL
86 | if: ${{ !cancelled() }}
87 | id: testAction3a2
88 | uses: ./
89 | with:
90 | project_path: tests/samples.xunit/AssertExamples
91 | report_name: tests_1_xunit_altxsl-${{ matrix.os }}
92 | report_title: Sample XUnit Tests (Alt XSL) (${{ matrix.os }})
93 | github_token: ${{ secrets.GITHUB_TOKEN }}
94 | gist_name: dotnet-tests-report_xunit_altxsl-${{ matrix.os }}.md
95 | gist_badge_label: 'XUnit Tests (Alt XSL): %Counters_passed%/%Counters_total%'
96 | gist_token: ${{ secrets.GIST_TOKEN }}
97 | trx_xsl_path: trx-report/trx2md-alt-sample.xsl
98 |
99 | - name: use this action, nunit project dir
100 | if: ${{ !cancelled() }}
101 | id: testAction3b
102 | uses: ./
103 | with:
104 | project_path: tests/nunit-csharp-samples/syntax
105 | report_name: tests_2_nunit-${{ matrix.os }}
106 | report_title: Sample NUnit Tests (${{ matrix.os }})
107 | github_token: ${{ secrets.GITHUB_TOKEN }}
108 | gist_name: dotnet-tests-report_nunit-${{ matrix.os }}.md
109 | gist_badge_label: 'NUnit Tests: %Counters_passed%/%Counters_total%'
110 | gist_token: ${{ secrets.GIST_TOKEN }}
111 |
112 | - name: use this action, mstest project dir
113 | if: ${{ !cancelled() }}
114 | id: testAction3c
115 | uses: ./
116 | with:
117 | project_path: tests/rafaelfgx_DotNetTests/MSTest
118 | report_name: tests_3_mstest-${{ matrix.os }}
119 | report_title: Sample MSTest Tests (${{ matrix.os }})
120 | github_token: ${{ secrets.GITHUB_TOKEN }}
121 | gist_name: dotnet-tests-report_mstest-${{ matrix.os }}.md
122 | gist_badge_label: 'MSTest Tests: %Counters_passed%/%Counters_total%'
123 | gist_token: ${{ secrets.GIST_TOKEN }}
124 |
125 | - name: dump test results
126 | shell: pwsh
127 | run: |
128 | Write-ActionInfo 'Testing on: ${{ matrix.os }}'
129 | Write-ActionInfo ' xUnit:'
130 | Write-ActionInfo ' * result_value = ${{ steps.testAction3a.outputs.result_value }}'
131 | Write-ActionInfo ' * total_count = ${{ steps.testAction3a.outputs.total_count }}'
132 | Write-ActionInfo ' * passed_count = ${{ steps.testAction3a.outputs.passed_count }}'
133 | Write-ActionInfo ' * failed_count = ${{ steps.testAction3a.outputs.failed_count }}'
134 | Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3a.outputs.gist_report_url }}'
135 | Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3a.outputs.gist_badge_url }}'
136 | Write-ActionInfo ''
137 | Write-ActionInfo ' xUnit (XSL Alt):'
138 | Write-ActionInfo ' * result_value = ${{ steps.testAction3a2.outputs.result_value }}'
139 | Write-ActionInfo ' * total_count = ${{ steps.testAction3a2.outputs.total_count }}'
140 | Write-ActionInfo ' * passed_count = ${{ steps.testAction3a2.outputs.passed_count }}'
141 | Write-ActionInfo ' * failed_count = ${{ steps.testAction3a2.outputs.failed_count }}'
142 | Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3a2.outputs.gist_report_url }}'
143 | Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3a2.outputs.gist_badge_url }}'
144 | Write-ActionInfo ''
145 | Write-ActionInfo ' NUnit:'
146 | Write-ActionInfo ' * result_value = ${{ steps.testAction3b.outputs.result_value }}'
147 | Write-ActionInfo ' * total_count = ${{ steps.testAction3b.outputs.total_count }}'
148 | Write-ActionInfo ' * passed_count = ${{ steps.testAction3b.outputs.passed_count }}'
149 | Write-ActionInfo ' * failed_count = ${{ steps.testAction3b.outputs.failed_count }}'
150 | Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3b.outputs.gist_report_url }}'
151 | Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3b.outputs.gist_badge_url }}'
152 | Write-ActionInfo ''
153 | Write-ActionInfo ' MSTest:'
154 | Write-ActionInfo ' * result_value = ${{ steps.testAction3c.outputs.result_value }}'
155 | Write-ActionInfo ' * total_count = ${{ steps.testAction3c.outputs.total_count }}'
156 | Write-ActionInfo ' * passed_count = ${{ steps.testAction3c.outputs.passed_count }}'
157 | Write-ActionInfo ' * failed_count = ${{ steps.testAction3c.outputs.failed_count }}'
158 | Write-ActionInfo ' * gist_report_url = ${{ steps.testAction3c.outputs.gist_report_url }}'
159 | Write-ActionInfo ' * gist_badge_url = ${{ steps.testAction3c.outputs.gist_badge_url }}'
160 | Write-ActionInfo ''
161 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ## Ignore Visual Studio temporary files, build results, and
2 | ## files generated by popular Visual Studio add-ons.
3 | ##
4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5 |
6 | # User-specific files
7 | *.suo
8 | *.user
9 | *.userosscache
10 | *.sln.docstates
11 |
12 | # User-specific files (MonoDevelop/Xamarin Studio)
13 | *.userprefs
14 |
15 | # Build results
16 | [Dd]ebug/
17 | [Dd]ebugPublic/
18 | [Rr]elease/
19 | [Rr]eleases/
20 | x64/
21 | x86/
22 | bld/
23 | [Bb]in/
24 | [Oo]bj/
25 | [Ll]og/
26 |
27 | # Visual Studio 2015/2017 cache/options directory
28 | .vs/
29 | # Uncomment if you have tasks that create the project's static files in wwwroot
30 | #wwwroot/
31 |
32 | # Visual Studio 2017 auto generated files
33 | Generated\ Files/
34 |
35 | # MSTest test Results
36 | [Tt]est[Rr]esult*/
37 | [Bb]uild[Ll]og.*
38 |
39 | # NUNIT
40 | *.VisualState.xml
41 | TestResult.xml
42 |
43 | # Build Results of an ATL Project
44 | [Dd]ebugPS/
45 | [Rr]eleasePS/
46 | dlldata.c
47 |
48 | # Benchmark Results
49 | BenchmarkDotNet.Artifacts/
50 |
51 | # .NET Core
52 | project.lock.json
53 | project.fragment.lock.json
54 | artifacts/
55 | **/Properties/launchSettings.json
56 |
57 | # StyleCop
58 | StyleCopReport.xml
59 |
60 | # Files built by Visual Studio
61 | *_i.c
62 | *_p.c
63 | *_i.h
64 | *.ilk
65 | *.meta
66 | *.obj
67 | *.iobj
68 | *.pch
69 | *.pdb
70 | *.ipdb
71 | *.pgc
72 | *.pgd
73 | *.rsp
74 | *.sbr
75 | *.tlb
76 | *.tli
77 | *.tlh
78 | *.tmp
79 | *.tmp_proj
80 | *.log
81 | *.vspscc
82 | *.vssscc
83 | .builds
84 | *.pidb
85 | *.svclog
86 | *.scc
87 |
88 | # Chutzpah Test files
89 | _Chutzpah*
90 |
91 | # Visual C++ cache files
92 | ipch/
93 | *.aps
94 | *.ncb
95 | *.opendb
96 | *.opensdf
97 | *.sdf
98 | *.cachefile
99 | *.VC.db
100 | *.VC.VC.opendb
101 |
102 | # Visual Studio profiler
103 | *.psess
104 | *.vsp
105 | *.vspx
106 | *.sap
107 |
108 | # Visual Studio Trace Files
109 | *.e2e
110 |
111 | # TFS 2012 Local Workspace
112 | $tf/
113 |
114 | # Guidance Automation Toolkit
115 | *.gpState
116 |
117 | # ReSharper is a .NET coding add-in
118 | _ReSharper*/
119 | *.[Rr]e[Ss]harper
120 | *.DotSettings.user
121 |
122 | # JustCode is a .NET coding add-in
123 | .JustCode
124 |
125 | # TeamCity is a build add-in
126 | _TeamCity*
127 |
128 | # DotCover is a Code Coverage Tool
129 | *.dotCover
130 |
131 | # AxoCover is a Code Coverage Tool
132 | .axoCover/*
133 | !.axoCover/settings.json
134 |
135 | # Visual Studio code coverage results
136 | *.coverage
137 | *.coveragexml
138 |
139 | # NCrunch
140 | _NCrunch_*
141 | .*crunch*.local.xml
142 | nCrunchTemp_*
143 |
144 | # MightyMoose
145 | *.mm.*
146 | AutoTest.Net/
147 |
148 | # Web workbench (sass)
149 | .sass-cache/
150 |
151 | # Installshield output folder
152 | [Ee]xpress/
153 |
154 | # DocProject is a documentation generator add-in
155 | DocProject/buildhelp/
156 | DocProject/Help/*.HxT
157 | DocProject/Help/*.HxC
158 | DocProject/Help/*.hhc
159 | DocProject/Help/*.hhk
160 | DocProject/Help/*.hhp
161 | DocProject/Help/Html2
162 | DocProject/Help/html
163 |
164 | # Click-Once directory
165 | publish/
166 |
167 | # Publish Web Output
168 | *.[Pp]ublish.xml
169 | *.azurePubxml
170 | # Note: Comment the next line if you want to checkin your web deploy settings,
171 | # but database connection strings (with potential passwords) will be unencrypted
172 | *.pubxml
173 | *.publishproj
174 |
175 | # Microsoft Azure Web App publish settings. Comment the next line if you want to
176 | # checkin your Azure Web App publish settings, but sensitive information contained
177 | # in these scripts will be unencrypted
178 | PublishScripts/
179 |
180 | # NuGet Packages
181 | *.nupkg
182 | # The packages folder can be ignored because of Package Restore
183 | **/[Pp]ackages/*
184 | # except build/, which is used as an MSBuild target.
185 | !**/[Pp]ackages/build/
186 | # Uncomment if necessary however generally it will be regenerated when needed
187 | #!**/[Pp]ackages/repositories.config
188 | # NuGet v3's project.json files produces more ignorable files
189 | *.nuget.props
190 | *.nuget.targets
191 |
192 | # Microsoft Azure Build Output
193 | csx/
194 | *.build.csdef
195 |
196 | # Microsoft Azure Emulator
197 | ecf/
198 | rcf/
199 |
200 | # Windows Store app package directories and files
201 | AppPackages/
202 | BundleArtifacts/
203 | Package.StoreAssociation.xml
204 | _pkginfo.txt
205 | *.appx
206 |
207 | # Visual Studio cache files
208 | # files ending in .cache can be ignored
209 | *.[Cc]ache
210 | # but keep track of directories ending in .cache
211 | !*.[Cc]ache/
212 |
213 | # Others
214 | ClientBin/
215 | ~$*
216 | *~
217 | *.dbmdl
218 | *.dbproj.schemaview
219 | *.jfm
220 | *.pfx
221 | *.publishsettings
222 | orleans.codegen.cs
223 |
224 | # Including strong name files can present a security risk
225 | # (https://github.com/github/gitignore/pull/2483#issue-259490424)
226 | #*.snk
227 |
228 | # Since there are multiple workflows, uncomment next line to ignore bower_components
229 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
230 | #bower_components/
231 |
232 | # RIA/Silverlight projects
233 | Generated_Code/
234 |
235 | # Backup & report files from converting an old project file
236 | # to a newer Visual Studio version. Backup files are not needed,
237 | # because we have git ;-)
238 | _UpgradeReport_Files/
239 | Backup*/
240 | UpgradeLog*.XML
241 | UpgradeLog*.htm
242 | ServiceFabricBackup/
243 | *.rptproj.bak
244 |
245 | # SQL Server files
246 | *.mdf
247 | *.ldf
248 | *.ndf
249 |
250 | # Business Intelligence projects
251 | *.rdl.data
252 | *.bim.layout
253 | *.bim_*.settings
254 | *.rptproj.rsuser
255 |
256 | # Microsoft Fakes
257 | FakesAssemblies/
258 |
259 | # GhostDoc plugin setting file
260 | *.GhostDoc.xml
261 |
262 | # Node.js Tools for Visual Studio
263 | .ntvs_analysis.dat
264 | node_modules/
265 |
266 | # Visual Studio 6 build log
267 | *.plg
268 |
269 | # Visual Studio 6 workspace options file
270 | *.opt
271 |
272 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
273 | *.vbw
274 |
275 | # Visual Studio LightSwitch build output
276 | **/*.HTMLClient/GeneratedArtifacts
277 | **/*.DesktopClient/GeneratedArtifacts
278 | **/*.DesktopClient/ModelManifest.xml
279 | **/*.Server/GeneratedArtifacts
280 | **/*.Server/ModelManifest.xml
281 | _Pvt_Extensions
282 |
283 | # Paket dependency manager
284 | .paket/paket.exe
285 | paket-files/
286 |
287 | # FAKE - F# Make
288 | .fake/
289 |
290 | # JetBrains Rider
291 | .idea/
292 | *.sln.iml
293 |
294 | # CodeRush
295 | .cr/
296 |
297 | # Python Tools for Visual Studio (PTVS)
298 | __pycache__/
299 | *.pyc
300 |
301 | # Cake - Uncomment if you are using it
302 | # tools/**
303 | # !tools/packages.config
304 |
305 | # Tabs Studio
306 | *.tss
307 |
308 | # Telerik's JustMock configuration file
309 | *.jmconfig
310 |
311 | # BizTalk build output
312 | *.btp.cs
313 | *.btm.cs
314 | *.odx.cs
315 | *.xsd.cs
316 |
317 | # OpenCover UI analysis results
318 | OpenCover/
319 |
320 | # Azure Stream Analytics local run output
321 | ASALocalRun/
322 |
323 | # MSBuild Binary and Structured Log
324 | *.binlog
325 |
326 | # NVidia Nsight GPU debugger configuration file
327 | *.nvuser
328 |
329 | # MFractors (Xamarin productivity tool) working folder
330 | .mfractor/
331 |
332 |
333 | ## Standard Ignores
334 | _IGNORE/
335 | _TMP/
336 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Eugene Bekker
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/NOTES.md:
--------------------------------------------------------------------------------
1 | # NOTES - some impl notes
2 |
3 | You get input from environment variables. More info here:
4 |
5 | * https://help.github.com/en/articles/metadata-syntax-for-github-actions#inputs
6 | * https://help.github.com/en/articles/*orkflow-syntax-for-github-actions#jobsjob_idstepswith
7 | * https://help.github.com/en/articles/virtual-environments-for-github-actions#environment-variables
8 |
9 | You can set output and invoke workflow actions by writing
10 | commands to the console output. More info here:
11 |
12 | * https://help.github.com/en/articles/development-tools-for-github-actions#logging-commands
13 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # dotnet-tests-report
2 |
3 | GitHub Action to run .NET tests and generate reports and badges.
4 |
5 | :star: I appreciate your star, it helps me decide to which OSS projects I should allocate my spare time.
6 |
7 | ---
8 |
9 | [](https://github.com/zyborg/dotnet-tests-report/actions?workflow=test-action)
10 | [](https://github.com/zyborg/dotnet-tests-report/releases/latest)
11 |
12 | ---
13 |
14 | This Action can be used to execute .NET tests using unit testing frameworks such as
15 | [xUnit](https://xunit.net/), [NUnit](https://nunit.org/) and
16 | [MSTest](https://docs.microsoft.com/en-us/dotnet/core/testing/unit-testing-with-mstest)
17 | within a GitHub Workflow, as well as generate a Report from the tests results and attach
18 | it to the Workflow Run as a Check Run.
19 |
20 | Check out the [usage](#usage) below.
21 |
22 | ## Samples
23 |
24 | Here we see some badges generated along with some _Gist-based_ Tests Reports as part
25 | of a GitHub Workflow associated with this project.
26 |
27 | * [](https://gist.github.com/ebekker/49933657cea4f772aef0320c94850f47)
28 | * [](https://gist.github.com/ebekker/35d1803fbae717e5115bd58a5aa0f939)
29 | * [](https://gist.github.com/ebekker/8c412f16593919d785696b2bc37f2d69)
30 |
31 |
32 | And here are some samples of the actual generated reports:
33 |
34 | Badges:
35 |
36 |
37 |  |
38 |  |
39 |
40 |
41 | Workflow Reports:
42 |
47 | Gist Reports:
48 |
49 |
50 |  |
51 |  |
52 |
53 |
54 |
55 | ## Usage
56 |
57 | Check out [action.yml](action.yml) for full usage details. Here are some samples.
58 |
59 | This is a basic example, that just provides a path to a single test project, and
60 | specifies the report name and title.
61 |
62 | ```yaml
63 | jobs:
64 | test:
65 | runs-on: ubuntu-latest
66 | steps:
67 | - name: use this action, test solution dir
68 | uses: zyborg/dotnet-tests-report@v1
69 | with:
70 | project_path: tests/My.Project.Tests
71 | report_name: my_project_tests
72 | report_title: My Project Tests
73 | github_token: ${{ secrets.GITHUB_TOKEN }}
74 | ```
75 |
76 | In this example, a _Gist-based_ report is generated along with the one that is
77 | attached to the Workflow Run. Additionally, we request a Badge be generated
78 | that shows the number of passed tests out of the total number of tests found.
79 | We do this for each of two separate unit test projects.
80 |
81 | ```yaml
82 | jobs:
83 | test:
84 | runs-on: ubuntu-latest
85 | steps:
86 |
87 | - name: unit tests for Contoso Business Layer
88 | uses: zyborg/dotnet-tests-report@v1
89 | with:
90 | project_path: tests/Contoso.Business.Tests
91 | report_name: contoso_business_tests
92 | report_title: Contos Business Tests
93 | github_token: ${{ secrets.GITHUB_TOKEN }}
94 | gist_name: contoso_business_tests.md
95 | gist_badge_label: 'Contoso Business: %Counters_passed%/%Counters_total%'
96 | gist_token: ${{ secrets.GIST_TOKEN }}
97 |
98 | - name: unit tests for Contoso Service Layer
99 | uses: zyborg/dotnet-tests-report@v1
100 | with:
101 | project_path: tests/Contoso.Service.Tests
102 | report_name: contoso_service_tests
103 | report_title: Contos Service Tests
104 | github_token: ${{ secrets.GITHUB_TOKEN }}
105 | gist_name: contoso_service_tests.md
106 | gist_badge_label: 'Contoso Service: %Counters_passed%/%Counters_total%'
107 | gist_token: ${{ secrets.GIST_TOKEN }}
108 | ```
109 |
110 | ---
111 |
112 | ### Set check status based on test outcome
113 | By default the [check status](https://docs.github.com/en/free-pro-team@latest/rest/reference/checks#create-a-check-run--parameters) is set to 'neutral'. Set the flag `set_check_status_from_test_outcome: true`.
114 | Note that setting this flag to `true` will fail the check on pull requests if at least one test fails in your project.
115 |
116 | ### PowerShell GitHub Action
117 |
118 | This Action is implemented as a [PowerShell GitHub Action](https://github.com/ebekker/pwsh-github-action-base).
119 |
--------------------------------------------------------------------------------
/Step-GitVersionTag.md:
--------------------------------------------------------------------------------
1 | # NOTES - Bumping Git Version Tag
2 |
3 | ```pwsh
4 | ## Confirm this looks good
5 | PS> Step-GitVersion -MajorVerTag v1 -Verbose
6 | ## Apply the change
7 | PS> Step-GitVersion -MajorVerTag v1 -Verbose -Apply
8 | ```
9 |
--------------------------------------------------------------------------------
/Step-GitVersionTag.ps1:
--------------------------------------------------------------------------------
1 | [CmdletBinding()]
2 | param(
3 | [Parameter(Mandatory)]
4 | [string]$MajorVerTag,
5 | [string]$Ref=$null,
6 |
7 | [switch]$Apply
8 | )
9 |
10 | if (-not $Ref) {
11 | Write-Verbose "No Ref specified, resolving latest tag matching SemVer version"
12 |
13 | if ($MajorVerTag -notmatch 'v[0-9]+') {
14 | Write-Warning "MajorVerTag does NOT specify a major semver pattern"
15 | Write-Warning "Ref cannot be resolved and MUST be specified"
16 | exit 1
17 | }
18 |
19 | $tags = git tag --list
20 | if (-not $tags) {
21 | Write-Warning "Could not find any existing tags"
22 | }
23 | else {
24 | Write-Verbose "Found [$($tags.Length)] tag(s)"
25 | $semverTags = $tags | Where-Object {
26 | $_ -match '^v[0-9]+(\.[0-9]+){1,3}$' -and $_.StartsWith($MajorVerTag)
27 | } | ForEach-Object {
28 | ## Drop the leading 'v' and convert to a Version
29 | ## instance so we can do properly ordered compare
30 | New-Object -TypeName psobject -Property @{
31 | tag = $_
32 | ver = [version]::new($_.Substring(1))
33 | }
34 | } | Sort-Object -Descending -Property ver
35 | $latestTag = $semverTags | Select-Object -First 1
36 | if (-not $latestTag) {
37 | Write-Warning "Found [$($tags.Length)] tag(s) but no version matching tags"
38 | Write-Warning "Ref cannot be resolved and must be specified"
39 | exit 1
40 | }
41 |
42 | $Ref = $latestTag.tag
43 | Write-Verbose "Resolved latest version-matching semver tag as [$($Ref)]"
44 | }
45 | }
46 |
47 | if (-not $Apply) {
48 | Write-Warning "Apply switch was not given, here's what I would do (VERBOSE):"
49 |
50 | Write-Verbose "Delete existing tag locally and remotely:"
51 | Write-Verbose " git tag -d $MajorVerTag"
52 | Write-Verbose " git push origin --delete $MajorVerTag"
53 | Write-Verbose "(Re-)Creating tag locally and remotely:"
54 | Write-Verbose " git tag $MajorVerTag $Ref"
55 | Write-Verbose " git push origin $MajorVerTag $Ref"
56 | }
57 | else {
58 | Write-Warning "Apply switch was given, applying changes"
59 |
60 | Write-Information "Delete existing tag locally and remotely:"
61 | & git tag -d $MajorVerTag
62 | & git push origin --delete $MajorVerTag
63 | ## Alternate (less intuitive) way to delete remove tag:
64 | #git push origin :refs/tags/$MajorVerTag
65 |
66 | Write-Information "(Re-)Creating tag locally and remotely:"
67 | & git tag $MajorVerTag $Ref
68 | & git push origin $MajorVerTag $Ref
69 | }
70 |
--------------------------------------------------------------------------------
/action.ps1:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env pwsh
2 |
3 | ## You interface with the Actions/Workflow system by interacting
4 | ## with the environment. The `GitHubActions` module makes this
5 | ## easier and more natural by wrapping up access to the Workflow
6 | ## environment in PowerShell-friendly constructions and idioms
7 | if (-not (Get-Module -ListAvailable GitHubActions)) {
8 | ## Make sure the GH Actions module is installed from the Gallery
9 | Install-Module GitHubActions -Force
10 | }
11 |
12 | ## Load up some common functionality for interacting
13 | ## with the GitHub Actions/Workflow environment
14 | Import-Module GitHubActions
15 |
16 | . $PSScriptRoot/action_helpers.ps1
17 |
18 | $inputs = @{
19 | test_results_path = Get-ActionInput test_results_path
20 | project_path = Get-ActionInput project_path
21 | no_restore = Get-ActionInput no_restore
22 | no_build = Get-ActionInput no_build
23 | msbuild_configuration = Get-ActionInput msbuild_configuration
24 | msbuild_verbosity = Get-ActionInput msbuild_verbosity
25 | report_name = Get-ActionInput report_name
26 | report_title = Get-ActionInput report_title
27 | github_token = Get-ActionInput github_token -Required
28 | skip_check_run = Get-ActionInput skip_check_run
29 | gist_name = Get-ActionInput gist_name
30 | gist_badge_label = Get-ActionInput gist_badge_label
31 | gist_badge_message = Get-ActionInput gist_badge_message
32 | gist_is_secret = Get-ActionInput gist_is_secret
33 | gist_token = Get-ActionInput gist_token -Required
34 | set_check_status_from_test_outcome = Get-ActionInput set_check_status_from_test_outcome
35 | trx_xsl_path = Get-ActionInput trx_xsl_path
36 | extra_test_parameters = Get-ActionInput extra_test_parameters
37 | fail_build_on_failed_tests = Get-ActionInput fail_build_on_failed_tests
38 | }
39 |
40 | $tmpDir = [System.IO.Path]::Combine($PWD, '_TMP')
41 | Write-ActionInfo "Resolved tmpDir as [$tmpDir]"
42 | $test_results_path = $inputs.test_results_path
43 | $test_report_path = Join-Path $tmpDir test-results.md
44 |
45 | New-Item -Name $tmpDir -ItemType Directory -Force -ErrorAction Ignore
46 |
47 | function Build-MarkdownReport {
48 | $script:report_name = $inputs.report_name
49 | $script:report_title = $inputs.report_title
50 | $script:trx_xsl_path = $inputs.trx_xsl_path
51 |
52 | if (-not $script:report_name) {
53 | $script:report_name = "TEST_RESULTS_$([datetime]::Now.ToString('yyyyMMdd_hhmmss'))"
54 | }
55 | if (-not $report_title) {
56 | $script:report_title = $report_name
57 | }
58 |
59 | $script:test_report_path = Join-Path $tmpDir test-results.md
60 | $trx2mdParams = @{
61 | trxFile = $script:test_results_path
62 | mdFile = $script:test_report_path
63 | xslParams = @{
64 | reportTitle = $script:report_title
65 | }
66 | }
67 | if ($script:trx_xsl_path) {
68 | $script:trx_xsl_path = "$(Resolve-Path $script:trx_xsl_path)"
69 | Write-ActionInfo "Override TRX XSL Path Provided"
70 | Write-ActionInfo " resolved as: $($script:trx_xsl_path)"
71 |
72 | if (Test-Path $script:trx_xsl_path) {
73 | ## If XSL path is provided and exists, override the default
74 | $trx2mdParams.xslFile = $script:trx_xsl_path
75 | }
76 | else {
77 | Write-ActionWarning "Could not find TRX XSL at resolved path; IGNORING"
78 | }
79 | }
80 | & "$PSScriptRoot/trx-report/trx2md.ps1" @trx2mdParams -Verbose
81 |
82 | }
83 |
84 | function Publish-ToCheckRun {
85 | param(
86 | [string]$reportData
87 | )
88 |
89 | Write-ActionInfo "Publishing Report to GH Workflow"
90 |
91 | $ghToken = $inputs.github_token
92 | $ctx = Get-ActionContext
93 | $repo = Get-ActionRepo
94 | $repoFullName = "$($repo.Owner)/$($repo.Repo)"
95 |
96 | Write-ActionInfo "Resolving REF"
97 | $ref = $ctx.Sha
98 | if ($ctx.EventName -eq 'pull_request') {
99 | Write-ActionInfo "Resolving PR REF"
100 | $ref = $ctx.Payload.pull_request.head.sha
101 | if (-not $ref) {
102 | Write-ActionInfo "Resolving PR REF as AFTER"
103 | $ref = $ctx.Payload.after
104 | }
105 | }
106 | if (-not $ref) {
107 | Write-ActionError "Failed to resolve REF"
108 | exit 1
109 | }
110 | Write-ActionInfo "Resolved REF as $ref"
111 | Write-ActionInfo "Resolve Repo Full Name as $repoFullName"
112 |
113 | Write-ActionInfo "Adding Check Run"
114 | $conclusion = 'neutral'
115 |
116 | # Set check status based on test result outcome.
117 | if ($inputs.set_check_status_from_test_outcome) {
118 |
119 | Write-ActionInfo "Mapping check status to test outcome..."
120 |
121 | if ($testResult.ResultSummary_outcome -eq "Failed") {
122 |
123 | Write-ActionWarning "Found failing tests"
124 | $conclusion = 'failure'
125 | }
126 | elseif ($testResult.ResultSummary_outcome -eq "Completed") {
127 |
128 | Write-ActionInfo "All tests passed"
129 | $conclusion = 'success'
130 | }
131 | }
132 |
133 | $url = "https://api.github.com/repos/$repoFullName/check-runs"
134 | $hdr = @{
135 | Accept = 'application/vnd.github.antiope-preview+json'
136 | Authorization = "token $ghToken"
137 | }
138 | $bdy = @{
139 | name = $report_name
140 | head_sha = $ref
141 | status = 'completed'
142 | conclusion = $conclusion
143 | output = @{
144 | title = $report_title
145 | summary = "This run completed at ``$([datetime]::Now)``"
146 | text = $reportData
147 | }
148 | }
149 | Invoke-WebRequest -Headers $hdr $url -Method Post -Body ($bdy | ConvertTo-Json)
150 | }
151 |
152 | function Publish-ToGist {
153 | param(
154 | [string]$reportData
155 | )
156 |
157 | Write-ActionInfo "Publishing Report to GH Workflow"
158 |
159 | $reportGistName = $inputs.gist_name
160 | $gist_token = $inputs.gist_token
161 | Write-ActionInfo "Resolved Report Gist Name.....: [$reportGistName]"
162 |
163 | $gistsApiUrl = "https://api.github.com/gists"
164 | $apiHeaders = @{
165 | Accept = "application/vnd.github.v2+json"
166 | Authorization = "token $gist_token"
167 | }
168 |
169 | ## Request all Gists for the current user
170 | $listGistsResp = Invoke-WebRequest -Headers $apiHeaders -Uri $gistsApiUrl
171 |
172 | ## Parse response content as JSON
173 | $listGists = $listGistsResp.Content | ConvertFrom-Json -AsHashtable
174 | Write-ActionInfo "Got [$($listGists.Count)] Gists for current account"
175 |
176 | ## Isolate the first Gist with a file matching the expected metadata name
177 | $reportGist = $listGists | Where-Object { $_.files.$reportGistName } | Select-Object -First 1
178 |
179 | if ($reportGist) {
180 | Write-ActionInfo "Found the Tests Report Gist!"
181 | ## Debugging:
182 | #$reportDataRawUrl = $reportGist.files.$reportGistName.raw_url
183 | #Write-ActionInfo "Fetching Tests Report content from Raw Url"
184 | #$reportDataRawResp = Invoke-WebRequest -Headers $apiHeaders -Uri $reportDataRawUrl
185 | #$reportDataContent = $reportDataRawResp.Content
186 | #if (-not $reportData) {
187 | # Write-ActionWarning "Tests Report content seems to be missing"
188 | # Write-ActionWarning "[$($reportGist.files.$reportGistName)]"
189 | # Write-ActionWarning "[$reportDataContent]"
190 | #}
191 | #else {
192 | # Write-Information "Got existing Tests Report"
193 | #}
194 | }
195 |
196 | $gistFiles = @{
197 | $reportGistName = @{
198 | content = $reportData
199 | }
200 | }
201 | if ($inputs.gist_badge_label) {
202 | $gist_badge_label = $inputs.gist_badge_label
203 | $gist_badge_message = $inputs.gist_badge_message
204 |
205 | if (-not $gist_badge_message) {
206 | $gist_badge_message = '%ResultSummary_outcome%'
207 | }
208 |
209 | $gist_badge_label = Resolve-EscapeTokens $gist_badge_label $testResult -UrlEncode
210 | $gist_badge_message = Resolve-EscapeTokens $gist_badge_message $testResult -UrlEncode
211 | $gist_badge_color = switch ($testResult.ResultSummary_outcome) {
212 | 'Completed' { 'green' }
213 | 'Failed' { 'red' }
214 | default { 'yellow' }
215 | }
216 | $gist_badge_url = "https://img.shields.io/badge/$gist_badge_label-$gist_badge_message-$gist_badge_color"
217 | Write-ActionInfo "Computed Badge URL: $gist_badge_url"
218 | $gistBadgeResult = Invoke-WebRequest $gist_badge_url -ErrorVariable $gistBadgeError
219 | if ($gistBadgeError) {
220 | $gistFiles."$($reportGistName)_badge.txt" = @{ content = $gistBadgeError.Message }
221 | }
222 | else {
223 | $gistFiles."$($reportGistName)_badge.svg" = @{ content = $gistBadgeResult.Content }
224 | }
225 | }
226 |
227 | if (-not $reportGist) {
228 | Write-ActionInfo "Creating initial Tests Report Gist"
229 | $createGistResp = Invoke-WebRequest -Headers $apiHeaders -Uri $gistsApiUrl -Method Post -Body (@{
230 | public = ($inputs.gist_is_secret -ne $true) ## Public or Secret Gist?
231 | files = $gistFiles
232 | } | ConvertTo-Json)
233 | $createGist = $createGistResp.Content | ConvertFrom-Json -AsHashtable
234 | $reportGist = $createGist
235 | Write-ActionInfo "Create Response: $createGistResp"
236 |
237 | Set-ActionOutput -Name gist_report_url -Value $createGist.html_url
238 | if ($gist_badge_label) {
239 | Set-ActionOutput -Name gist_badge_url -Value $createGist.files."$($reportGistName)_badge.svg".raw_url
240 | }
241 | }
242 | else {
243 | Write-ActionInfo "Updating Tests Report Gist"
244 | $updateGistUrl = "$gistsApiUrl/$($reportGist.id)"
245 | $updateGistResp = Invoke-WebRequest -Headers $apiHeaders -Uri $updateGistUrl -Method Patch -Body (@{
246 | files = $gistFiles
247 | } | ConvertTo-Json)
248 | $updateGist = $updateGistResp.Content | ConvertFrom-Json -AsHashtable
249 | Write-ActionInfo "Update Response: $updateGistResp"
250 |
251 | Set-ActionOutput -Name gist_report_url -Value $updateGist.html_url
252 | if ($gist_badge_label) {
253 | Set-ActionOutput -Name gist_badge_url -Value $updateGist.files."$($reportGistName)_badge.svg".raw_url
254 | }
255 | }
256 | }
257 |
258 | [bool]$testsfailed = $false
259 |
260 | if ($test_results_path) {
261 | Write-ActionInfo "TRX Test Results Path provided as input; skipping test invocation"
262 | }
263 | else {
264 | $dotnet = Get-Command dotnet -ErrorAction SilentlyContinue
265 | if (-not $dotnet) {
266 | Write-ActionError "Unable to resolve the `dotnet` executable; ABORTING!"
267 | exit 1
268 | }
269 | else {
270 | Write-ActionInfo "Resolved `dotnet` executable:"
271 | Write-ActionInfo " * path.......: [$($dotnet.Path)]"
272 | $dotnetVersion = & $dotnet.Path --version
273 | Write-ActionInfo " * version....: [$($dotnetVersion)]"
274 | }
275 |
276 | $trxName = 'test-results.trx'
277 | $test_results_path = Join-Path $tmpDir $trxName
278 |
279 | $no_restore = $inputs.no_restore
280 | $no_build = $inputs.no_build
281 | $msbuild_configuration = $inputs.msbuild_configuration
282 | $msbuild_verbosity = $inputs.msbuild_verbosity
283 |
284 | if (-not $msbuild_verbosity) {
285 | $msbuild_verbosity = 'normal'
286 | }
287 |
288 | $dotnetArgs = @(
289 | 'test'
290 | '--verbosity',$msbuild_verbosity
291 | '--results-directory',$tmpDir
292 | '--logger',"`"trx;LogFileName=$trxName`""
293 | )
294 |
295 | if ($msbuild_configuration) {
296 | $dotnetArgs += '--configuration'
297 | $dotnetArgs += $msbuild_configuration
298 | }
299 |
300 | if ($no_restore -eq 'true') {
301 | $dotnetArgs += '--no-restore'
302 | }
303 |
304 | if ($no_build -eq 'true') {
305 | $dotnetArgs += '--no-build'
306 | }
307 |
308 | if ($inputs.extra_test_parameters) {
309 | # we need to add the extra parameters to the array @dotnetArgs
310 | $dotnetArgs += $inputs.extra_test_parameters -split ' '
311 | }
312 |
313 | # The project path has to be after all switches so this needs to be last
314 | if ($inputs.project_path) {
315 | $dotnetArgs += $inputs.project_path
316 | }
317 |
318 | Write-ActionInfo "Assembled test invocation arguments:"
319 | Write-ActionInfo " $dotnetArgs"
320 |
321 | Write-ActionInfo "Invoking..."
322 | & $dotnet.Path @dotnetArgs
323 |
324 | if (-not $?) {
325 | $testsfailed = $true
326 | Write-ActionWarning "Execution of tests returned failure: $LASTEXITCODE"
327 | }
328 | if (-not (Test-Path -PathType Leaf $test_results_path)) {
329 | Write-ActionWarning "Execution of tests DID NOT PRODUCE a tests results file"
330 | }
331 | }
332 |
333 | if ($test_results_path) {
334 | Set-ActionOutput -Name test_results_path -Value $test_results_path
335 |
336 | Write-ActionInfo "Compiling Test Result object"
337 | $testResultXml = Select-Xml -Path $test_results_path -XPath /
338 | $testResult = [psobject]::new()
339 | $testResultXml.Node.TestRun.Attributes | % { $testResult |
340 | Add-Member -MemberType NoteProperty -Name "TestRun_$($_.Name)" -Value $_.Value }
341 | $testResultXml.Node.TestRun.Times.Attributes | % { $testResult |
342 | Add-Member -MemberType NoteProperty -Name "Times_$($_.Name)" -Value $_.Value }
343 | $testResultXml.Node.TestRun.ResultSummary.Attributes | % { $testResult |
344 | Add-Member -MemberType NoteProperty -Name "ResultSummary_$($_.Name)" -Value $_.Value }
345 | $testResultXml.Node.TestRun.ResultSummary.Counters.Attributes | % { $testResult |
346 | Add-Member -MemberType NoteProperty -Name "Counters_$($_.Name)" -Value $_.Value }
347 | Write-ActionInfo "$($testResult|Out-Default)"
348 |
349 | $result_clixml_path = Join-Path $tmpDir dotnet-test-result.clixml
350 | Export-Clixml -InputObject $testResult -Path $result_clixml_path
351 |
352 | Set-ActionOutput -Name result_clixml_path -Value $result_clixml_path
353 | Set-ActionOutput -Name result_value -Value ($testResult.ResultSummary_outcome)
354 | Set-ActionOutput -Name total_count -Value ($testResult.Counters_total)
355 | Set-ActionOutput -Name passed_count -Value ($testResult.Counters_passed)
356 | Set-ActionOutput -Name failed_count -Value ($testResult.Counters_failed)
357 |
358 | Write-ActionInfo "Generating Markdown Report from TRX file"
359 | Build-MarkdownReport
360 | $reportData = [System.IO.File]::ReadAllText($test_report_path)
361 |
362 | if ($inputs.skip_check_run -ne $true) {
363 | Publish-ToCheckRun -ReportData $reportData
364 | }
365 | if ($inputs.gist_name -and $inputs.gist_token) {
366 | Publish-ToGist -ReportData $reportData
367 | }
368 | }
369 |
370 | if ($testsfailed -and $inputs.fail_build_on_failed_tests) {
371 | Write-ActionError "Tests failed so failing build..."
372 | exit 1
373 | }
374 |
--------------------------------------------------------------------------------
/action.yml:
--------------------------------------------------------------------------------
1 |
2 | ## This is a SAMPLE metadata file for a GitHub Action. For more info:
3 | ## https://help.github.com/en/articles/metadata-syntax-for-github-actions
4 |
5 | name: dotnet-tests-report
6 | author: EBekker
7 | description: |
8 | Executes .NET (dotnet) tests within a GitHub Workflow
9 | and produces Tests Report.
10 |
11 | ## Here you describe your *formal* inputs -- those that are
12 | ## documented and can be displayed by the marketplace.
13 | ## You also use these to identify the *required* inputs.
14 | inputs:
15 |
16 | test_results_path:
17 | description: |
18 | Path to the test results file which will be used to generate a report.
19 | If this path is provided, it will override the invocation
20 | of `dotnet test` so the **`project_path`** input and all
21 | other inputs that drive test invocation behavior will be
22 | ignored. Instead a report will be generated based on the
23 | results stored in the file pointed to by this path.
24 | At this time, the only test results format supported is the
25 | [Visual Studio Test Results (TRX)](https://docs.microsoft.com/en-us/visualstudio/test/vstest-console-options?view=vs-2019)
26 | XML format.
27 |
28 | project_path:
29 | description: |
30 | The project or solution file to operate on. If a file or
31 | directory path is not specified, the command will assume
32 | the project root path.
33 | required: false
34 |
35 | no_restore:
36 | description:
37 | When executing the unit tests against the `project_path`,
38 | if this input parameter is `true`, do not restore the
39 | project before building.
40 | required: false
41 |
42 | no_build:
43 | description:
44 | When executing the unit tests against the `project_path`,
45 | if this input parameter is `true`, do not build the
46 | project before executing tests.
47 | required: false
48 |
49 | msbuild_configuration:
50 | description:
51 | When executing the unit tests against the `project_path`,
52 | this input parameter allows you to specify the configuration
53 | passed to the msbuild process, such as `Release` or `Debug`.
54 | required: false
55 |
56 | msbuild_verbosity:
57 | description:
58 | When executing the unit tests against the `project_path`,
59 | this input parameter allows you to specify the verbosity
60 | level of the msbuild process. Allowed values are
61 | q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic].
62 | required: false
63 |
64 | report_name:
65 | description: |
66 | The name of the report object that will be attached to the
67 | Workflow Run. Defaults to the name `TEST_RESULTS_`
68 | where `` is in the form `yyyyMMdd_hhmmss`.
69 |
70 | report_title:
71 | description: |
72 | The title of the report that will be embedded in the report
73 | itself, which defaults to the same as the `report_name` input.
74 |
75 | github_token:
76 | description: |
77 | GITHUB_TOKEN to authenticate against API calls to attach
78 | report to Workflow Run.
79 |
80 | skip_check_run:
81 | description: |
82 | If true, will skip attaching the Tests Result report to
83 | the Workflow Run using a Check Run. Useful if you just
84 | want to produce a Gist-based report via the `gist_name`
85 | and `gist_token` input parameters.
86 |
87 | gist_name:
88 | description: |
89 | If this value is specified, the Test Results Report will be
90 | attached as a version of a Gist under the name of this input.
91 | The `gist_token` input is also required to use this feature.
92 |
93 | gist_badge_label:
94 | description: |
95 | If specified, the Test Report Gist will also include an adjacent
96 | badge rendered with the status of the associated Test Report and
97 | and label content of this input. In addition to any static text
98 | you can provide _escape tokens_ of the form `%name%` where name
99 | can be the name of any field returned from a Pester Result, such
100 | as `ExecutedAt` or `Result`. If you want a literal percent, just
101 | specify an empty name as in `%%`.
102 |
103 | gist_badge_message:
104 | description: |
105 | If Gist badge generation is enabled by providing a value for the
106 | `gist_badge_label` input, this input allows you to override the
107 | default message on the badge, which is equivalent to the the
108 | Pester Result `Status` such as `Failed` or `Passed`. As with the
109 | label input, you can specify escape tokens in addition to literal
110 | text. See the label input description for more details.
111 |
112 | gist_is_secret:
113 | description: |
114 | If true, will create the Tests Results Gist will be created as a
115 | _secret_ Gist, otherwise it will be created as a public Gist.
116 | Secret Gists can be changed to public, but public Gists cannot be
117 | change to secret. More details can be found
118 | [here](https://docs.github.com/en/github/writing-on-github/creating-gists#about-gists).
119 |
120 | gist_token:
121 | description: |
122 | GitHub OAuth/PAT token to be used for accessing Gist to store
123 | test results report. The integrated GITHUB_TOKEN that is normally
124 | accessible during a Workflow does not include read/write permissions
125 | to associated Gists, therefore a separate token is needed.
126 | You can control which account is used to actually store the state by
127 | generating a token associated with the target account.
128 |
129 | set_check_status_from_test_outcome:
130 | description: |
131 | If set to true, GitHub check status will be set to 'failure'
132 | if at least one test fails. If all tests pass then check status will
133 | be set to 'success'.
134 |
135 | trx_xsl_path:
136 | description: |
137 | If specified, will override the default XSL transformation stylesheet
138 | used to convert TRX input file to a Markdown report.
139 |
140 | extra_test_parameters:
141 | description: |
142 | Useful for passing extra parameters to dotnet test. Eg,
143 | '--filter category=unit'
144 |
145 | fail_build_on_failed_tests:
146 | description: |
147 | If set to true, the build will fail if at least one test fails
148 |
149 |
150 | ## Here you describe your *formal* outputs.
151 | outputs:
152 |
153 | test_results_path:
154 | description: |
155 | Path to the test results file. If the same-named input
156 | was provided to this action, this value will be the same.
157 | Otherwise, this will be the path to where the test results
158 | file was generated from running the resolved dotnet tests.
159 | At this time, the only test results format supported is the
160 | [Visual Studio Test Results (TRX)](https://docs.microsoft.com/en-us/visualstudio/test/vstest-console-options?view=vs-2019)
161 | XML format.
162 |
163 | result_clixml_path:
164 | description:
165 | If a test_result_path was successfully produced by a test
166 | invocation or one was passed in as an input, then this will
167 | be the path to an export of the results summary in CLIXML
168 | form. A subsequent PowerShell step can recover
169 | this object using the `Import-Clixml` cmdlet.
170 |
171 | result_value:
172 | description: |
173 | A single string indicating the final result such as
174 | `Failed` or `Completed`.
175 |
176 | gist_report_url:
177 | description: |
178 | If Gist-based Test Results were requested,
179 | this will contain the URL to the Gist.
180 |
181 | gist_badge_url:
182 | description: |
183 | If Gist-based Test Results were requested as well as a status badge,
184 | this will contain the URL to the status badge.
185 |
186 | total_count:
187 | description: Total number of tests discovered.
188 |
189 | passed_count:
190 | description: Total number of tests passed.
191 |
192 | failed_count:
193 | description: Total number of tests failed.
194 |
195 |
196 | branding:
197 | color: purple
198 | icon: check-circle
199 |
200 | ## Even though the Action logic may be implemented
201 | ## in PWSH, we still need a NodeJS entry point
202 | runs:
203 | using: node12
204 | main: _init/index.js
205 |
--------------------------------------------------------------------------------
/action_helpers.ps1:
--------------------------------------------------------------------------------
1 |
2 | function splitListInput { $args[0] -split ',' | % { $_.Trim() } }
3 | function writeListInput { $args[0] | % { Write-ActionInfo " - $_" } }
4 |
5 |
6 | function Resolve-EscapeTokens {
7 | param(
8 | [object]$Message,
9 | [object]$Context,
10 | [switch]$UrlEncode
11 | )
12 |
13 | $m = ''
14 | $Message = $Message.ToString()
15 | $p2 = -1
16 | $p1 = $Message.IndexOf('%')
17 | while ($p1 -gt -1) {
18 | $m += $Message.Substring($p2 + 1, $p1 - $p2 - 1)
19 | $p2 = $Message.IndexOf('%', $p1 + 1)
20 | if ($p2 -lt 0) {
21 | $m += $Message.Substring($p1)
22 | break
23 | }
24 | $etName = $Message.Substring($p1 + 1, $p2 - $p1 - 1)
25 | if ($etName -eq '') {
26 | $etValue = '%'
27 | }
28 | else {
29 | $etValue = $Context.$etName
30 | }
31 | $m += $etValue
32 | $p1 = $Message.IndexOf('%', $p2 + 1)
33 | }
34 | $m += $Message.Substring($p2 + 1)
35 |
36 | if ($UrlEncode) {
37 | $m = [System.Web.HTTPUtility]::UrlEncode($m).Replace('+', '%20')
38 | }
39 |
40 | $m
41 | }
--------------------------------------------------------------------------------
/build.ps1:
--------------------------------------------------------------------------------
1 | param(
2 | [switch]$UpgradePackages
3 | )
4 |
5 | if ($UpgradePackages) {
6 | & npm upgrade "@actions/core"
7 | & npm upgrade "@actions/exec"
8 | }
9 |
10 | ncc build .\invoke-pwsh.js -o _init
11 |
--------------------------------------------------------------------------------
/docs/sample-badges1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyborg/dotnet-tests-report/69608ac4fc7a5f48dad05a358b91e40996e67fdf/docs/sample-badges1.png
--------------------------------------------------------------------------------
/docs/sample-badges2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyborg/dotnet-tests-report/69608ac4fc7a5f48dad05a358b91e40996e67fdf/docs/sample-badges2.png
--------------------------------------------------------------------------------
/docs/sample-checkrun-report1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyborg/dotnet-tests-report/69608ac4fc7a5f48dad05a358b91e40996e67fdf/docs/sample-checkrun-report1.png
--------------------------------------------------------------------------------
/docs/sample-checkrun-report2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyborg/dotnet-tests-report/69608ac4fc7a5f48dad05a358b91e40996e67fdf/docs/sample-checkrun-report2.png
--------------------------------------------------------------------------------
/docs/sample-checkrun-report3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyborg/dotnet-tests-report/69608ac4fc7a5f48dad05a358b91e40996e67fdf/docs/sample-checkrun-report3.png
--------------------------------------------------------------------------------
/docs/sample-failure1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyborg/dotnet-tests-report/69608ac4fc7a5f48dad05a358b91e40996e67fdf/docs/sample-failure1.png
--------------------------------------------------------------------------------
/docs/sample-gist-report1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zyborg/dotnet-tests-report/69608ac4fc7a5f48dad05a358b91e40996e67fdf/docs/sample-gist-report1.png
--------------------------------------------------------------------------------
/invoke-pwsh.js:
--------------------------------------------------------------------------------
1 |
2 | const core = require('@actions/core');
3 | const exec = require('@actions/exec');
4 |
5 | async function run() {
6 | try {
7 | const pwshFolder = __dirname.replace(/[/\\]_init$/, '');
8 | const pwshScript = `${pwshFolder}/action.ps1`
9 | await exec.exec('pwsh', [ '-f', pwshScript ]);
10 | } catch (error) {
11 | core.setFailed(error.message);
12 | }
13 | }
14 | run();
15 |
--------------------------------------------------------------------------------
/package-lock.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "invoke-pwsh",
3 | "version": "1.0.0",
4 | "lockfileVersion": 1,
5 | "requires": true,
6 | "dependencies": {
7 | "@actions/core": {
8 | "version": "1.2.6",
9 | "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.6.tgz",
10 | "integrity": "sha512-ZQYitnqiyBc3D+k7LsgSBmMDVkOVidaagDG7j3fOym77jNunWRuYx7VSHa9GNfFZh+zh61xsCjRj4JxMZlDqTA=="
11 | },
12 | "@actions/exec": {
13 | "version": "1.0.4",
14 | "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.4.tgz",
15 | "integrity": "sha512-4DPChWow9yc9W3WqEbUj8Nr86xkpyE29ZzWjXucHItclLbEW6jr80Zx4nqv18QL6KK65+cifiQZXvnqgTV6oHw==",
16 | "requires": {
17 | "@actions/io": "^1.0.1"
18 | }
19 | },
20 | "@actions/io": {
21 | "version": "1.0.2",
22 | "resolved": "https://registry.npmjs.org/@actions/io/-/io-1.0.2.tgz",
23 | "integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg=="
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "invoke-pwsh",
3 | "version": "1.0.0",
4 | "description": "Invoke PWSH-based GitHub Action.",
5 | "main": "invoke-pwsh.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "author": "EBekker",
10 | "license": "MIT",
11 | "dependencies": {
12 | "@actions/core": "^1.2.6",
13 | "@actions/exec": "^1.0.4"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tests/nunit-csharp-samples/README.md:
--------------------------------------------------------------------------------
1 | # xUnit Samples
2 |
3 | These samples were borrowed and adapted from the NUnit samples project found
4 | [here](https://github.com/nunit/nunit-csharp-samples/tree/9cc4916fa2bb596ab7a41d95dee258c258c13fd5).
5 |
--------------------------------------------------------------------------------
/tests/nunit-csharp-samples/syntax/AssertSyntaxTests.cs:
--------------------------------------------------------------------------------
1 | using System.Collections;
2 |
3 | namespace NUnit.Framework.Tests
4 | {
5 | ///
6 | /// This test fixture attempts to exercise all the syntactic
7 | /// variations of Assert without getting into failures, errors
8 | /// or corner cases. Thus, some of the tests may be duplicated
9 | /// in other fixtures.
10 | ///
11 | /// Each test performs the same operations using the classic
12 | /// syntax (if available) and the new syntax in both the
13 | /// helper-based and inherited forms.
14 | ///
15 | /// This Fixture will eventually be duplicated in other
16 | /// supported languages.
17 | ///
18 | [TestFixture]
19 | public class AssertSyntaxTests
20 | {
21 | #region Simple Constraint Tests
22 | [Test]
23 | public void IsNull()
24 | {
25 | object nada = null;
26 |
27 | // Classic syntax
28 | Assert.IsNull(nada);
29 |
30 | // Constraint Syntax
31 | Assert.That(nada, Is.Null);
32 | }
33 |
34 | [Test]
35 | public void IsNotNull()
36 | {
37 | // Classic syntax
38 | Assert.IsNotNull(42);
39 |
40 | // Constraint Syntax
41 | Assert.That(42, Is.Not.Null);
42 | }
43 |
44 | [Test]
45 | public void IsTrue()
46 | {
47 | // Classic syntax
48 | Assert.IsTrue(2+2==4);
49 |
50 | // Constraint Syntax
51 | Assert.That(2+2==4, Is.True);
52 | Assert.That(2+2==4);
53 | }
54 |
55 | [Test]
56 | public void IsFalse()
57 | {
58 | // Classic syntax
59 | Assert.IsFalse(2+2==5);
60 |
61 | // Constraint Syntax
62 | Assert.That(2+2== 5, Is.False);
63 | }
64 |
65 | [Test]
66 | public void IsNaN()
67 | {
68 | double d = double.NaN;
69 | float f = float.NaN;
70 |
71 | // Classic syntax
72 | Assert.IsNaN(d);
73 | Assert.IsNaN(f);
74 |
75 | // Constraint Syntax
76 | Assert.That(d, Is.NaN);
77 | Assert.That(f, Is.NaN);
78 | }
79 |
80 | [Test]
81 | public void EmptyStringTests()
82 | {
83 | // Classic syntax
84 | Assert.IsEmpty("");
85 | Assert.IsNotEmpty("Hello!");
86 |
87 | // Constraint Syntax
88 | Assert.That("", Is.Empty);
89 | Assert.That("Hello!", Is.Not.Empty);
90 | }
91 |
92 | [Test]
93 | public void EmptyCollectionTests()
94 | {
95 | // Classic syntax
96 | Assert.IsEmpty(new bool[0]);
97 | Assert.IsNotEmpty(new int[] { 1, 2, 3 });
98 |
99 | // Constraint Syntax
100 | Assert.That(new bool[0], Is.Empty);
101 | Assert.That(new int[] { 1, 2, 3 }, Is.Not.Empty);
102 | }
103 | #endregion
104 |
105 | #region TypeConstraint Tests
106 | [Test]
107 | public void ExactTypeTests()
108 | {
109 | // Classic syntax workarounds
110 | Assert.AreEqual(typeof(string), "Hello".GetType());
111 | Assert.AreEqual("System.String", "Hello".GetType().FullName);
112 | Assert.AreNotEqual(typeof(int), "Hello".GetType());
113 | Assert.AreNotEqual("System.Int32", "Hello".GetType().FullName);
114 |
115 | // Constraint Syntax
116 | Assert.That("Hello", Is.TypeOf(typeof(string)));
117 | Assert.That("Hello", Is.Not.TypeOf(typeof(int)));
118 | }
119 |
120 | [Test]
121 | public void InstanceOfTests()
122 | {
123 | // Classic syntax
124 | Assert.IsInstanceOf(typeof(string), "Hello");
125 | Assert.IsNotInstanceOf(typeof(string), 5);
126 |
127 | // Constraint Syntax
128 | Assert.That("Hello", Is.InstanceOf(typeof(string)));
129 | Assert.That(5, Is.Not.InstanceOf(typeof(string)));
130 | }
131 |
132 | [Test]
133 | public void AssignableFromTypeTests()
134 | {
135 | // Classic syntax
136 | Assert.IsAssignableFrom(typeof(string), "Hello");
137 | Assert.IsNotAssignableFrom(typeof(string), 5);
138 |
139 | // Constraint Syntax
140 | Assert.That( "Hello", Is.AssignableFrom(typeof(string)));
141 | Assert.That( 5, Is.Not.AssignableFrom(typeof(string)));
142 | }
143 | #endregion
144 |
145 | #region StringConstraint Tests
146 | [Test]
147 | public void SubstringTests()
148 | {
149 | string phrase = "Hello World!";
150 | string[] array = new string[] { "abc", "bad", "dba" };
151 |
152 | // Classic Syntax
153 | StringAssert.Contains("World", phrase);
154 |
155 | // Constraint Syntax
156 | Assert.That(phrase, Does.Contain("World"));
157 | // Only available using new syntax
158 | Assert.That(phrase, Does.Not.Contain("goodbye"));
159 | Assert.That(phrase, Does.Contain("WORLD").IgnoreCase);
160 | Assert.That(phrase, Does.Not.Contain("BYE").IgnoreCase);
161 | Assert.That(array, Is.All.Contains( "b" ) );
162 | }
163 |
164 | [Test]
165 | public void StartsWithTests()
166 | {
167 | string phrase = "Hello World!";
168 | string[] greetings = new string[] { "Hello!", "Hi!", "Hola!" };
169 |
170 | // Classic syntax
171 | StringAssert.StartsWith("Hello", phrase);
172 |
173 | // Constraint Syntax
174 | Assert.That(phrase, Does.StartWith("Hello"));
175 | // Only available using new syntax
176 | Assert.That(phrase, Does.Not.StartWith("Hi!"));
177 | Assert.That(phrase, Does.StartWith("HeLLo").IgnoreCase);
178 | Assert.That(phrase, Does.Not.StartWith("HI").IgnoreCase);
179 | Assert.That(greetings, Is.All.StartsWith("h").IgnoreCase);
180 | }
181 |
182 | [Test]
183 | public void EndsWithTests()
184 | {
185 | string phrase = "Hello World!";
186 | string[] greetings = new string[] { "Hello!", "Hi!", "Hola!" };
187 |
188 | // Classic Syntax
189 | StringAssert.EndsWith("!", phrase);
190 |
191 | // Constraint Syntax
192 | Assert.That(phrase, Does.EndWith("!"));
193 | // Only available using new syntax
194 | Assert.That(phrase, Does.Not.EndWith("?"));
195 | Assert.That(phrase, Does.EndWith("WORLD!").IgnoreCase);
196 | Assert.That(greetings, Is.All.EndsWith("!"));
197 | }
198 |
199 | [Test]
200 | public void EqualIgnoringCaseTests()
201 | {
202 | string phrase = "Hello World!";
203 |
204 | // Classic syntax
205 | StringAssert.AreEqualIgnoringCase("hello world!",phrase);
206 |
207 | // Constraint Syntax
208 | Assert.That(phrase, Is.EqualTo("hello world!").IgnoreCase);
209 | //Only available using new syntax
210 | Assert.That(phrase, Is.Not.EqualTo("goodbye world!").IgnoreCase);
211 | Assert.That(new string[] { "Hello", "World" },
212 | Is.EqualTo(new object[] { "HELLO", "WORLD" }).IgnoreCase);
213 | Assert.That(new string[] {"HELLO", "Hello", "hello" },
214 | Is.All.EqualTo( "hello" ).IgnoreCase);
215 | }
216 |
217 | [Test]
218 | public void RegularExpressionTests()
219 | {
220 | string phrase = "Now is the time for all good men to come to the aid of their country.";
221 | string[] quotes = new string[] { "Never say never", "It's never too late", "Nevermore!" };
222 |
223 | // Classic syntax
224 | StringAssert.IsMatch( "all good men", phrase );
225 | StringAssert.IsMatch( "Now.*come", phrase );
226 |
227 | // Constraint Syntax
228 | Assert.That( phrase, Does.Match( "all good men" ) );
229 | Assert.That( phrase, Does.Match( "Now.*come" ) );
230 | // Only available using new syntax
231 | Assert.That(phrase, Does.Not.Match("all.*men.*good"));
232 | Assert.That(phrase, Does.Match("ALL").IgnoreCase);
233 | Assert.That(quotes, Is.All.Matches("never").IgnoreCase);
234 | }
235 | #endregion
236 |
237 | #region Equality Tests
238 | [Test]
239 | public void EqualityTests()
240 | {
241 | int[] i3 = new int[] { 1, 2, 3 };
242 | double[] d3 = new double[] { 1.0, 2.0, 3.0 };
243 | int[] iunequal = new int[] { 1, 3, 2 };
244 |
245 | // Classic Syntax
246 | Assert.AreEqual(4, 2 + 2);
247 | Assert.AreEqual(i3, d3);
248 | Assert.AreNotEqual(5, 2 + 2);
249 | Assert.AreNotEqual(i3, iunequal);
250 |
251 | // Constraint Syntax
252 | Assert.That(2 + 2, Is.EqualTo(4));
253 | Assert.That(2 + 2 == 4);
254 | Assert.That(i3, Is.EqualTo(d3));
255 | Assert.That(2 + 2, Is.Not.EqualTo(5));
256 | Assert.That(i3, Is.Not.EqualTo(iunequal));
257 | }
258 |
259 | [Test]
260 | public void EqualityTestsWithTolerance()
261 | {
262 | // CLassic syntax
263 | Assert.AreEqual(5.0d, 4.99d, 0.05d);
264 | Assert.AreEqual(5.0f, 4.99f, 0.05f);
265 |
266 | // Constraint Syntax
267 | Assert.That(4.99d, Is.EqualTo(5.0d).Within(0.05d));
268 | Assert.That(4.0d, Is.Not.EqualTo(5.0d).Within(0.5d));
269 | Assert.That(4.99f, Is.EqualTo(5.0f).Within(0.05f));
270 | Assert.That(4.99m, Is.EqualTo(5.0m).Within(0.05m));
271 | Assert.That(3999999999u, Is.EqualTo(4000000000u).Within(5u));
272 | Assert.That(499, Is.EqualTo(500).Within(5));
273 | Assert.That(4999999999L, Is.EqualTo(5000000000L).Within(5L));
274 | Assert.That(5999999999ul, Is.EqualTo(6000000000ul).Within(5ul));
275 | }
276 |
277 | [Test]
278 | public void EqualityTestsWithTolerance_MixedFloatAndDouble()
279 | {
280 | // Bug Fix 1743844
281 | Assert.That(2.20492d, Is.EqualTo(2.2d).Within(0.01f),
282 | "Double actual, Double expected, Single tolerance");
283 | Assert.That(2.20492d, Is.EqualTo(2.2f).Within(0.01d),
284 | "Double actual, Single expected, Double tolerance" );
285 | Assert.That(2.20492d, Is.EqualTo(2.2f).Within(0.01f),
286 | "Double actual, Single expected, Single tolerance" );
287 | Assert.That(2.20492f, Is.EqualTo(2.2f).Within(0.01d),
288 | "Single actual, Single expected, Double tolerance");
289 | Assert.That(2.20492f, Is.EqualTo(2.2d).Within(0.01d),
290 | "Single actual, Double expected, Double tolerance");
291 | Assert.That(2.20492f, Is.EqualTo(2.2d).Within(0.01f),
292 | "Single actual, Double expected, Single tolerance");
293 | }
294 |
295 | [Test]
296 | public void EqualityTestsWithTolerance_MixingTypesGenerally()
297 | {
298 | // Extending tolerance to all numeric types
299 | Assert.That(202d, Is.EqualTo(200d).Within(2),
300 | "Double actual, Double expected, int tolerance");
301 | Assert.That( 4.87m, Is.EqualTo(5).Within(.25),
302 | "Decimal actual, int expected, Double tolerance" );
303 | Assert.That( 4.87m, Is.EqualTo(5ul).Within(1),
304 | "Decimal actual, ulong expected, int tolerance" );
305 | Assert.That( 487, Is.EqualTo(500).Within(25),
306 | "int actual, int expected, int tolerance" );
307 | Assert.That( 487u, Is.EqualTo(500).Within(25),
308 | "uint actual, int expected, int tolerance" );
309 | Assert.That( 487L, Is.EqualTo(500).Within(25),
310 | "long actual, int expected, int tolerance" );
311 | Assert.That( 487ul, Is.EqualTo(500).Within(25),
312 | "ulong actual, int expected, int tolerance" );
313 | }
314 | #endregion
315 |
316 | #region Comparison Tests
317 | [Test]
318 | public void ComparisonTests()
319 | {
320 | // Classic Syntax
321 | Assert.Greater(7, 3);
322 | Assert.GreaterOrEqual(7, 3);
323 | Assert.GreaterOrEqual(7, 7);
324 |
325 | // Constraint Syntax
326 | Assert.That(7, Is.GreaterThan(3));
327 | Assert.That(7, Is.GreaterThanOrEqualTo(3));
328 | Assert.That(7, Is.AtLeast(3));
329 | Assert.That(7, Is.GreaterThanOrEqualTo(7));
330 | Assert.That(7, Is.AtLeast(7));
331 |
332 | // Classic syntax
333 | Assert.Less(3, 7);
334 | Assert.LessOrEqual(3, 7);
335 | Assert.LessOrEqual(3, 3);
336 |
337 | // Constraint Syntax
338 | Assert.That(3, Is.LessThan(7));
339 | Assert.That(3, Is.LessThanOrEqualTo(7));
340 | Assert.That(3, Is.AtMost(7));
341 | Assert.That(3, Is.LessThanOrEqualTo(3));
342 | Assert.That(3, Is.AtMost(3));
343 | }
344 | #endregion
345 |
346 | #region Collection Tests
347 | [Test]
348 | public void AllItemsTests()
349 | {
350 | object[] ints = new object[] { 1, 2, 3, 4 };
351 | object[] doubles = new object[] { 0.99, 2.1, 3.0, 4.05 };
352 | object[] strings = new object[] { "abc", "bad", "cab", "bad", "dad" };
353 |
354 | // Classic syntax
355 | CollectionAssert.AllItemsAreNotNull(ints);
356 | CollectionAssert.AllItemsAreInstancesOfType(ints, typeof(int));
357 | CollectionAssert.AllItemsAreInstancesOfType(strings, typeof(string));
358 | CollectionAssert.AllItemsAreUnique(ints);
359 |
360 | // Constraint Syntax
361 | Assert.That(ints, Is.All.Not.Null);
362 | Assert.That(ints, Has.None.Null);
363 | Assert.That(ints, Is.All.InstanceOf(typeof(int)));
364 | Assert.That(ints, Has.All.InstanceOf(typeof(int)));
365 | Assert.That(strings, Is.All.InstanceOf(typeof(string)));
366 | Assert.That(strings, Has.All.InstanceOf(typeof(string)));
367 | Assert.That(ints, Is.Unique);
368 | // Only available using new syntax
369 | Assert.That(strings, Is.Not.Unique);
370 | Assert.That(ints, Is.All.GreaterThan(0));
371 | Assert.That(ints, Has.All.GreaterThan(0));
372 | Assert.That(ints, Has.None.LessThanOrEqualTo(0));
373 | Assert.That(strings, Is.All.Contains( "a" ) );
374 | Assert.That(strings, Has.All.Contains( "a" ) );
375 | Assert.That(strings, Has.Some.StartsWith( "ba" ) );
376 | Assert.That( strings, Has.Some.Property( "Length" ).EqualTo( 3 ) );
377 | Assert.That( strings, Has.Some.StartsWith( "BA" ).IgnoreCase );
378 | Assert.That( doubles, Has.Some.EqualTo( 1.0 ).Within( .05 ) );
379 | }
380 |
381 | [Test]
382 | public void SomeItemTests()
383 | {
384 | object[] mixed = new object[] { 1, 2, "3", null, "four", 100 };
385 | object[] strings = new object[] { "abc", "bad", "cab", "bad", "dad" };
386 |
387 | // Not available using the classic syntax
388 |
389 | // Constraint Syntax
390 | Assert.That(mixed, Has.Some.Null);
391 | Assert.That(mixed, Has.Some.InstanceOf(typeof(int)));
392 | Assert.That(mixed, Has.Some.InstanceOf(typeof(string)));
393 | Assert.That(strings, Has.Some.StartsWith( "ba" ) );
394 | Assert.That(strings, Has.Some.Not.StartsWith( "ba" ) );
395 | }
396 |
397 | [Test]
398 | public void NoItemTests()
399 | {
400 | object[] ints = new object[] { 1, 2, 3, 4, 5 };
401 | object[] strings = new object[] { "abc", "bad", "cab", "bad", "dad" };
402 |
403 | // Not available using the classic syntax
404 |
405 | // Constraint Syntax
406 | Assert.That(ints, Has.None.Null);
407 | Assert.That(ints, Has.None.InstanceOf(typeof(string)));
408 | Assert.That(ints, Has.None.GreaterThan(99));
409 | Assert.That(strings, Has.None.StartsWith( "qu" ) );
410 | }
411 |
412 | [Test]
413 | public void CollectionContainsTests()
414 | {
415 | int[] iarray = new int[] { 1, 2, 3 };
416 | string[] sarray = new string[] { "a", "b", "c" };
417 |
418 | // Classic syntax
419 | Assert.Contains(3, iarray);
420 | Assert.Contains("b", sarray);
421 | CollectionAssert.Contains(iarray, 3);
422 | CollectionAssert.Contains(sarray, "b");
423 | CollectionAssert.DoesNotContain(sarray, "x");
424 | // Showing that Contains uses NUnit equality
425 | CollectionAssert.Contains( iarray, 1.0d );
426 |
427 | // Constraint Syntax
428 | Assert.That(iarray, Has.Member(3));
429 | Assert.That(sarray, Has.Member("b"));
430 | Assert.That(sarray, Has.No.Member("x"));
431 | // Showing that Contains uses NUnit equality
432 | Assert.That(iarray, Has.Member( 1.0d ));
433 |
434 | // Only available using the new syntax
435 | // Note that EqualTo and SameAs do NOT give
436 | // identical results to Contains because
437 | // Contains uses Object.Equals()
438 | Assert.That(iarray, Has.Some.EqualTo(3));
439 | Assert.That(iarray, Has.Member(3));
440 | Assert.That(sarray, Has.Some.EqualTo("b"));
441 | Assert.That(sarray, Has.None.EqualTo("x"));
442 | Assert.That(iarray, Has.None.SameAs( 1.0d ));
443 | Assert.That(iarray, Has.All.LessThan(10));
444 | Assert.That(sarray, Has.All.Length.EqualTo(1));
445 | Assert.That(sarray, Has.None.Property("Length").GreaterThan(3));
446 | }
447 |
448 | [Test]
449 | public void CollectionEquivalenceTests()
450 | {
451 | int[] ints1to5 = new int[] { 1, 2, 3, 4, 5 };
452 | int[] twothrees = new int[] { 1, 2, 3, 3, 4, 5 };
453 | int[] twofours = new int[] { 1, 2, 3, 4, 4, 5 };
454 |
455 | // Classic syntax
456 | CollectionAssert.AreEquivalent(new int[] { 2, 1, 4, 3, 5 }, ints1to5);
457 | CollectionAssert.AreNotEquivalent(new int[] { 2, 2, 4, 3, 5 }, ints1to5);
458 | CollectionAssert.AreNotEquivalent(new int[] { 2, 4, 3, 5 }, ints1to5);
459 | CollectionAssert.AreNotEquivalent(new int[] { 2, 2, 1, 1, 4, 3, 5 }, ints1to5);
460 | CollectionAssert.AreNotEquivalent(twothrees, twofours);
461 |
462 | // Constraint Syntax
463 | Assert.That(new int[] { 2, 1, 4, 3, 5 }, Is.EquivalentTo(ints1to5));
464 | Assert.That(new int[] { 2, 2, 4, 3, 5 }, Is.Not.EquivalentTo(ints1to5));
465 | Assert.That(new int[] { 2, 4, 3, 5 }, Is.Not.EquivalentTo(ints1to5));
466 | Assert.That(new int[] { 2, 2, 1, 1, 4, 3, 5 }, Is.Not.EquivalentTo(ints1to5));
467 | }
468 |
469 | [Test]
470 | public void SubsetTests()
471 | {
472 | int[] ints1to5 = new int[] { 1, 2, 3, 4, 5 };
473 |
474 | // Classic syntax
475 | CollectionAssert.IsSubsetOf(new int[] { 1, 3, 5 }, ints1to5);
476 | CollectionAssert.IsSubsetOf(new int[] { 1, 2, 3, 4, 5 }, ints1to5);
477 | CollectionAssert.IsNotSubsetOf(new int[] { 2, 4, 6 }, ints1to5);
478 | CollectionAssert.IsNotSubsetOf(new int[] { 1, 2, 2, 2, 5 }, ints1to5);
479 |
480 | // Constraint Syntax
481 | Assert.That(new int[] { 1, 3, 5 }, Is.SubsetOf(ints1to5));
482 | Assert.That(new int[] { 1, 2, 3, 4, 5 }, Is.SubsetOf(ints1to5));
483 | Assert.That(new int[] { 2, 4, 6 }, Is.Not.SubsetOf(ints1to5));
484 | }
485 | #endregion
486 |
487 | #region Property Tests
488 | [Test]
489 | public void PropertyTests()
490 | {
491 | string[] array = { "abc", "bca", "xyz", "qrs" };
492 | string[] array2 = { "a", "ab", "abc" };
493 | ArrayList list = new ArrayList( array );
494 |
495 | // Not available using the classic syntax
496 |
497 | // Constraint Syntax
498 | Assert.That( list, Has.Property( "Count" ) );
499 | Assert.That( list, Has.No.Property( "Length" ) );
500 |
501 | Assert.That( "Hello", Has.Length.EqualTo( 5 ) );
502 | Assert.That( "Hello", Has.Length.LessThan( 10 ) );
503 | Assert.That( "Hello", Has.Property("Length").EqualTo(5) );
504 | Assert.That( "Hello", Has.Property("Length").GreaterThan(3) );
505 |
506 | Assert.That( array, Has.Property( "Length" ).EqualTo( 4 ) );
507 | Assert.That( array, Has.Length.EqualTo( 4 ) );
508 | Assert.That( array, Has.Property( "Length" ).LessThan( 10 ) );
509 |
510 | Assert.That( array, Has.All.Property("Length").EqualTo(3) );
511 | Assert.That( array, Has.All.Length.EqualTo( 3 ) );
512 | Assert.That( array, Is.All.Length.EqualTo( 3 ) );
513 | Assert.That( array, Has.All.Property("Length").EqualTo(3) );
514 | Assert.That( array, Is.All.Property("Length").EqualTo(3) );
515 |
516 | Assert.That( array2, Has.Some.Property("Length").EqualTo(2) );
517 | Assert.That( array2, Has.Some.Length.EqualTo(2) );
518 | Assert.That( array2, Has.Some.Property("Length").GreaterThan(2) );
519 |
520 | Assert.That( array2, Is.Not.Property("Length").EqualTo(4) );
521 | Assert.That( array2, Is.Not.Length.EqualTo( 4 ) );
522 | Assert.That( array2, Has.No.Property("Length").GreaterThan(3) );
523 |
524 | Assert.That( List.Map( array2 ).Property("Length"), Is.EqualTo( new int[] { 1, 2, 3 } ) );
525 | Assert.That( List.Map( array2 ).Property("Length"), Is.EquivalentTo( new int[] { 3, 2, 1 } ) );
526 | Assert.That( List.Map( array2 ).Property("Length"), Is.SubsetOf( new int[] { 1, 2, 3, 4, 5 } ) );
527 | Assert.That( List.Map( array2 ).Property("Length"), Is.Unique );
528 |
529 | Assert.That( list, Has.Count.EqualTo( 4 ) );
530 | }
531 | #endregion
532 |
533 | #region Not Tests
534 | [Test]
535 | public void NotTests()
536 | {
537 | // Not available using the classic syntax
538 |
539 | // Constraint Syntax
540 | Assert.That(42, Is.Not.Null);
541 | Assert.That(42, Is.Not.True);
542 | Assert.That(42, Is.Not.False);
543 | Assert.That(2.5, Is.Not.NaN);
544 | Assert.That(2 + 2, Is.Not.EqualTo(3));
545 | Assert.That(2 + 2, Is.Not.Not.EqualTo(4));
546 | Assert.That(2 + 2, Is.Not.Not.Not.EqualTo(5));
547 | }
548 | #endregion
549 |
550 | #region Operator Tests
551 | [Test]
552 | public void NotOperator()
553 | {
554 | // The ! operator is only available in the new syntax
555 | Assert.That(42, !Is.Null);
556 | }
557 |
558 | [Test]
559 | public void AndOperator()
560 | {
561 | // The & operator is only available in the new syntax
562 | Assert.That(7, Is.GreaterThan(5) & Is.LessThan(10));
563 | }
564 |
565 | [Test]
566 | public void OrOperator()
567 | {
568 | // The | operator is only available in the new syntax
569 | Assert.That(3, Is.LessThan(5) | Is.GreaterThan(10));
570 | }
571 |
572 | [Test]
573 | public void ComplexTests()
574 | {
575 | Assert.That(7, Is.Not.Null & Is.Not.LessThan(5) & Is.Not.GreaterThan(10));
576 |
577 | Assert.That(7, !Is.Null & !Is.LessThan(5) & !Is.GreaterThan(10));
578 |
579 | // No longer works at all under 3.0
580 | // TODO: Evaluate why we wanted to use null in this setting in the first place
581 | #if false
582 | // TODO: Remove #if when mono compiler can handle null
583 | #if MONO
584 | Constraint x = null;
585 | Assert.That(7, !x & !Is.LessThan(5) & !Is.GreaterThan(10));
586 | Expect(7, !x & !LessThan(5) & !GreaterThan(10));
587 | #else
588 | Assert.That(7, !(Constraint)null & !Is.LessThan(5) & !Is.GreaterThan(10));
589 | Expect(7, !(Constraint)null & !LessThan(5) & !GreaterThan(10));
590 | #endif
591 | #endif
592 | }
593 | #endregion
594 |
595 | #region Invalid Code Tests
596 | // This method contains assertions that should not compile
597 | // You can check by uncommenting it.
598 | //public void WillNotCompile()
599 | //{
600 | // Assert.That(42, Is.Not);
601 | // Assert.That(42, Is.All);
602 | // Assert.That(42, Is.Null.Not);
603 | // Assert.That(42, Is.Not.Null.GreaterThan(10));
604 | // Assert.That(42, Is.GreaterThan(10).LessThan(99));
605 |
606 | // object[] c = new object[0];
607 | // Assert.That(c, Is.Null.All);
608 | // Assert.That(c, Is.Not.All);
609 | // Assert.That(c, Is.All.Not);
610 | //}
611 | #endregion
612 |
613 | #region Assumptions
614 |
615 | [Test]
616 | public void PositiveAssumption()
617 | {
618 | Assume.That(true);
619 |
620 | Assert.Pass("This will be executed because of the assumption.");
621 | }
622 |
623 | [Test]
624 | public void NegativeAssumption()
625 | {
626 | Assume.That(false);
627 |
628 | Assert.Fail("This will not be executed because of the assumption.");
629 | }
630 |
631 | #endregion
632 |
633 | #region Warnings
634 |
635 | [Test]
636 | public void PositiveWarning()
637 | {
638 | Warn.If(true, "This will emit a warning");
639 | Warn.Unless(false, "This will emit a warning");
640 |
641 | Assert.Pass("This test passes despite the warnings.");
642 | }
643 |
644 | [Test]
645 | public void NegativeWarning()
646 | {
647 | Warn.If(false, "This will not emit a warning");
648 | Warn.Unless(true, "This will not emit a warning");
649 |
650 | Assert.Pass("This test passes despite the warnings.");
651 | }
652 |
653 | #endregion
654 | }
655 |
656 | }
657 |
--------------------------------------------------------------------------------
/tests/nunit-csharp-samples/syntax/syntax.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 | NUnit.Framework.Tests
6 |
7 | false
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Calculator/Calculator.cs:
--------------------------------------------------------------------------------
1 | namespace Data
2 | {
3 | public sealed class Calculator : ICalculator
4 | {
5 | public decimal Divide(decimal number1, decimal number2) => number1 / number2;
6 |
7 | public decimal Multiply(decimal number1, decimal number2) => number1 * number2;
8 |
9 | public decimal Subtract(decimal number1, decimal number2) => number1 - number2;
10 |
11 | public decimal Sum(decimal number1, decimal number2) => number1 + number2;
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Calculator/ICalculator.cs:
--------------------------------------------------------------------------------
1 | namespace Data
2 | {
3 | public interface ICalculator
4 | {
5 | decimal Divide(decimal number1, decimal number2);
6 |
7 | decimal Multiply(decimal number1, decimal number2);
8 |
9 | decimal Subtract(decimal number1, decimal number2);
10 |
11 | decimal Sum(decimal number1, decimal number2);
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Data.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | netstandard2.0
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Data.csproj.ORIG:
--------------------------------------------------------------------------------
1 |
2 |
3 | netcoreapp3.1
4 |
5 |
6 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Entities/Customer.cs:
--------------------------------------------------------------------------------
1 | namespace Data
2 | {
3 | public class Customer
4 | {
5 | public string Email { get; set; }
6 |
7 | public string FirstName { get; set; }
8 |
9 | public int Id { get; set; }
10 |
11 | public string LastName { get; set; }
12 |
13 | public string Telephone { get; set; }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Entities/Order.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 |
4 | namespace Data
5 | {
6 | public class Order
7 | {
8 | public Customer Customer { get; set; }
9 |
10 | public DateTime Date { get; set; }
11 |
12 | public int Id { get; set; }
13 |
14 | public IList Items { get; set; }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Entities/OrderItem.cs:
--------------------------------------------------------------------------------
1 | namespace Data
2 | {
3 | public class OrderItem
4 | {
5 | public int Id { get; set; }
6 |
7 | public Order Order { get; set; }
8 |
9 | public Product Product { get; set; }
10 |
11 | public int Quantity { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/Data/Entities/Product.cs:
--------------------------------------------------------------------------------
1 | namespace Data
2 | {
3 | public class Product
4 | {
5 | public string Description { get; set; }
6 |
7 | public int Id { get; set; }
8 |
9 | public string Name { get; set; }
10 |
11 | public float Price { get; set; }
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/MSTest/FakeItEasyTest.cs:
--------------------------------------------------------------------------------
1 | using Data;
2 | using FakeItEasy;
3 | using Microsoft.VisualStudio.TestTools.UnitTesting;
4 | using System;
5 |
6 | namespace MSTest
7 | {
8 | [TestClass]
9 | public class FakeItEasyTest
10 | {
11 | [TestMethod]
12 | public void Divide()
13 | {
14 | var calculator = A.Fake();
15 |
16 | A.CallTo(() => calculator.Divide(A.Ignored, A.Ignored)).Returns(100);
17 |
18 | Assert.AreEqual(100, calculator.Divide(1000, 10));
19 | }
20 |
21 | [TestMethod]
22 | [ExpectedException(typeof(DivideByZeroException))]
23 | public void DivideByZeroException()
24 | {
25 | var calculator = A.Fake();
26 |
27 | A.CallTo(() => calculator.Divide(A.Ignored, 0)).Throws(new DivideByZeroException());
28 |
29 | calculator.Divide(1000, 0);
30 | }
31 |
32 | [TestMethod]
33 | public void Multiply()
34 | {
35 | var calculator = A.Fake();
36 |
37 | A.CallTo(() => calculator.Multiply(A.Ignored, A.Ignored)).Returns(100);
38 |
39 | Assert.AreEqual(100, calculator.Multiply(5, 20));
40 | }
41 |
42 | [TestMethod]
43 | public void Subtract()
44 | {
45 | var calculator = A.Fake();
46 |
47 | A.CallTo(() => calculator.Subtract(A.Ignored, A.Ignored)).Returns(100);
48 |
49 | Assert.AreEqual(100, calculator.Subtract(150, 50));
50 | }
51 |
52 | [TestMethod]
53 | public void Sum()
54 | {
55 | var calculator = A.Fake();
56 |
57 | A.CallTo(() => calculator.Sum(A.Ignored, A.Ignored)).Returns(100);
58 |
59 | Assert.AreEqual(100, calculator.Sum(40, 60));
60 | }
61 |
62 | [TestMethod]
63 | public void SumParameters()
64 | {
65 | var calculator = A.Fake();
66 |
67 | A.CallTo(() => calculator.Sum(0, 0)).Returns(0);
68 |
69 | A.CallTo(() => calculator.Sum(40, 60)).Returns(100);
70 |
71 | Assert.AreEqual(0, calculator.Sum(0, 0));
72 |
73 | Assert.AreEqual(100, calculator.Sum(40, 60));
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/MSTest/MSTest.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net5.0
4 | false
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/MSTest/MSTest.csproj.ORIG:
--------------------------------------------------------------------------------
1 |
2 |
3 | netcoreapp3.1
4 | false
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/MSTest/MoqTest.cs:
--------------------------------------------------------------------------------
1 | using Data;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using Moq;
4 | using System;
5 |
6 | namespace MSTest
7 | {
8 | [TestClass]
9 | public class MoqTest
10 | {
11 | [TestMethod]
12 | public void Divide()
13 | {
14 | var calculator = new Mock();
15 |
16 | calculator.Setup(x => x.Divide(It.IsAny(), It.IsAny())).Returns(100);
17 |
18 | Assert.AreEqual(100, calculator.Object.Divide(1000, 10));
19 | }
20 |
21 | [TestMethod]
22 | [ExpectedException(typeof(DivideByZeroException))]
23 | public void DivideByZeroException()
24 | {
25 | var calculator = new Mock();
26 |
27 | calculator.Setup(x => x.Divide(It.IsAny(), 0)).Throws(new DivideByZeroException());
28 |
29 | calculator.Object.Divide(1000, 0);
30 | }
31 |
32 | [TestMethod]
33 | public void Multiply()
34 | {
35 | var calculator = new Mock();
36 |
37 | calculator.Setup(x => x.Multiply(It.IsAny(), It.IsAny())).Returns(100);
38 |
39 | Assert.AreEqual(100, calculator.Object.Multiply(5, 20));
40 | }
41 |
42 | [TestMethod]
43 | public void Subtract()
44 | {
45 | var calculator = new Mock();
46 |
47 | calculator.Setup(x => x.Subtract(It.IsAny(), It.IsAny())).Returns(100);
48 |
49 | Assert.AreEqual(100, calculator.Object.Subtract(150, 50));
50 | }
51 |
52 | [TestMethod]
53 | public void Sum()
54 | {
55 | var calculator = new Mock();
56 |
57 | calculator.Setup(x => x.Sum(It.IsAny(), It.IsAny())).Returns(100);
58 |
59 | Assert.AreEqual(100, calculator.Object.Sum(40, 60));
60 | }
61 |
62 | [TestMethod]
63 | public void SumParameters()
64 | {
65 | var calculator = new Mock();
66 |
67 | calculator.Setup(x => x.Sum(0, 0)).Returns(0);
68 |
69 | calculator.Setup(x => x.Sum(40, 60)).Returns(100);
70 |
71 | Assert.AreEqual(0, calculator.Object.Sum(0, 0));
72 |
73 | Assert.AreEqual(100, calculator.Object.Sum(40, 60));
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/MSTest/NBuilderTest.cs:
--------------------------------------------------------------------------------
1 | using Data;
2 | using FizzWare.NBuilder;
3 | using Microsoft.VisualStudio.TestTools.UnitTesting;
4 |
5 | namespace MSTest
6 | {
7 | [TestClass]
8 | public class NBuilderTest
9 | {
10 | [TestMethod]
11 | public void Builder()
12 | {
13 | var order = Builder.CreateNew().Build();
14 |
15 | order.Customer = Builder.CreateNew().Build();
16 |
17 | var products = Builder.CreateListOfSize(500).Build();
18 |
19 | order.Items = Builder
20 | .CreateListOfSize(5)
21 | .All()
22 | .With(item => item.Order = order)
23 | .With(item => item.Product = Pick.RandomItemFrom(products))
24 | .Build();
25 |
26 | Assert.IsNotNull(order);
27 |
28 | Assert.IsTrue(order.Items.Count == 5);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/MSTest/NSubstituteTest.cs:
--------------------------------------------------------------------------------
1 | using Data;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using NSubstitute;
4 | using System;
5 |
6 | namespace MSTest
7 | {
8 | [TestClass]
9 | public class NSubstituteTest
10 | {
11 | [TestMethod]
12 | public void Divide()
13 | {
14 | var calculator = Substitute.For();
15 |
16 | calculator.Divide(Arg.Any(), Arg.Any()).Returns(100);
17 |
18 | Assert.AreEqual(100, calculator.Divide(1000, 10));
19 | }
20 |
21 | [TestMethod]
22 | [ExpectedException(typeof(DivideByZeroException))]
23 | public void DivideByZeroException()
24 | {
25 | var calculator = Substitute.For();
26 |
27 | calculator.Divide(1000, 0).Returns(_ => throw new DivideByZeroException());
28 |
29 | calculator.Divide(1000, 0);
30 | }
31 |
32 | [TestMethod]
33 | public void Multiply()
34 | {
35 | var calculator = Substitute.For();
36 |
37 | calculator.Multiply(Arg.Any(), Arg.Any()).Returns(100);
38 |
39 | Assert.AreEqual(100, calculator.Multiply(5, 20));
40 | }
41 |
42 | [TestMethod]
43 | public void Subtract()
44 | {
45 | var calculator = Substitute.For();
46 |
47 | calculator.Subtract(Arg.Any(), Arg.Any()).Returns(100);
48 |
49 | Assert.AreEqual(100, calculator.Subtract(150, 50));
50 | }
51 |
52 | [TestMethod]
53 | public void Sum()
54 | {
55 | var calculator = Substitute.For();
56 |
57 | calculator.Sum(Arg.Any(), Arg.Any()).Returns(100);
58 |
59 | Assert.AreEqual(100, calculator.Sum(40, 60));
60 | }
61 |
62 | [TestMethod]
63 | public void SumParameters()
64 | {
65 | var calculator = Substitute.For();
66 |
67 | calculator.Sum(0, 0).Returns(0);
68 |
69 | calculator.Sum(40, 60).Returns(100);
70 |
71 | Assert.AreEqual(0, calculator.Sum(0, 0));
72 |
73 | Assert.AreEqual(100, calculator.Sum(40, 60));
74 | }
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/MSTest/RealTest.cs:
--------------------------------------------------------------------------------
1 | using Data;
2 | using Microsoft.VisualStudio.TestTools.UnitTesting;
3 | using System;
4 |
5 | namespace MSTest
6 | {
7 | [TestClass]
8 | public class RealTest
9 | {
10 | private readonly ICalculator _calculator = new Calculator();
11 |
12 | [TestMethod]
13 | public void Divide()
14 | {
15 | Assert.AreEqual(100, _calculator.Divide(1000, 10));
16 | }
17 |
18 | [ExpectedException(typeof(DivideByZeroException))]
19 | [TestMethod]
20 | public void DivideByZeroException()
21 | {
22 | _calculator.Divide(1000, 0);
23 | }
24 |
25 | [TestMethod]
26 | public void Multiply()
27 | {
28 | Assert.AreEqual(100, _calculator.Multiply(5, 20));
29 | }
30 |
31 | [TestMethod]
32 | public void Subtract()
33 | {
34 | Assert.AreEqual(100, _calculator.Subtract(150, 50));
35 | }
36 |
37 | [TestMethod]
38 | public void Sum()
39 | {
40 | Assert.AreEqual(100, _calculator.Sum(40, 60));
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/tests/rafaelfgx_DotNetTests/README.md:
--------------------------------------------------------------------------------
1 | # MSTest Samples
2 |
3 | These samples were borrowed from the MSTest samples from the project found
4 | [here](https://github.com/rafaelfgx/DotNetTests/tree/da9e11c0917d19be7d1dfaff64401b6345d1c502).
5 |
--------------------------------------------------------------------------------
/tests/samples.xunit/AssertExamples/AssertExamples.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | net5.0
5 |
6 | false
7 |
8 |
9 |
10 |
11 |
12 |
13 | runtime; build; native; contentfiles; analyzers; buildtransitive
14 | all
15 |
16 |
17 | runtime; build; native; contentfiles; analyzers; buildtransitive
18 | all
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/tests/samples.xunit/AssertExamples/AssertExamples.csproj.ORIG:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | true
5 | full
6 | net452
7 |
8 |
9 |
10 |
11 |
12 | all
13 | runtime; build; native; contentfiles; analyzers; buildtransitive
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/tests/samples.xunit/AssertExamples/AsyncExamples.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Threading.Tasks;
3 | using Xunit;
4 |
5 | public class AsyncExamples
6 | {
7 | [Fact]
8 | public async void CodeThrowsAsync()
9 | {
10 | Func testCode = () => Task.Factory.StartNew(ThrowingMethod);
11 |
12 | var ex = await Assert.ThrowsAsync(testCode);
13 |
14 | Assert.IsType(ex);
15 | }
16 |
17 | [Fact]
18 | public async void RecordAsync()
19 | {
20 | Func testCode = () => Task.Factory.StartNew(ThrowingMethod);
21 |
22 | var ex = await Record.ExceptionAsync(testCode);
23 |
24 | Assert.IsType(ex);
25 | }
26 |
27 | void ThrowingMethod()
28 | {
29 | throw new NotImplementedException();
30 | }
31 | }
32 |
33 |
--------------------------------------------------------------------------------
/tests/samples.xunit/AssertExamples/CollectionExample.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xunit;
4 |
5 | namespace AssertExtensibility
6 | {
7 | // Collection equivalence means the collections have the exact same values
8 | // in any order.
9 |
10 | public class CollectionExamples
11 | {
12 | [Fact]
13 | public void CollectionEquality()
14 | {
15 | List left = new List(new int[] { 4, 12, 16, 27 });
16 | List right = new List(new int[] { 4, 12, 16, 27 });
17 |
18 | Assert.Equal(left, right, new CollectionEquivalenceComparer());
19 | }
20 |
21 | [Fact]
22 | public void LeftCollectionSmallerThanRight()
23 | {
24 | List left = new List(new int[] { 4, 12, 16 });
25 | List right = new List(new int[] { 4, 12, 16, 27 });
26 |
27 | Assert.NotEqual(left, right, new CollectionEquivalenceComparer());
28 | }
29 |
30 | [Fact]
31 | public void LeftCollectionLargerThanRight()
32 | {
33 | List left = new List(new int[] { 4, 12, 16, 27, 42 });
34 | List right = new List(new int[] { 4, 12, 16, 27 });
35 |
36 | Assert.NotEqual(left, right, new CollectionEquivalenceComparer());
37 | }
38 |
39 | [Fact]
40 | public void SameValuesOutOfOrder()
41 | {
42 | List left = new List(new int[] { 4, 16, 12, 27 });
43 | List right = new List(new int[] { 4, 12, 16, 27 });
44 |
45 | Assert.Equal(left, right, new CollectionEquivalenceComparer());
46 | }
47 |
48 | [Fact]
49 | public void DuplicatedItemInOneListOnly()
50 | {
51 | List left = new List(new int[] { 4, 16, 12, 27, 4 });
52 | List right = new List(new int[] { 4, 12, 16, 27 });
53 |
54 | Assert.NotEqual(left, right, new CollectionEquivalenceComparer());
55 | }
56 |
57 | [Fact]
58 | public void DuplicatedItemInBothLists()
59 | {
60 | List left = new List(new int[] { 4, 16, 12, 27, 4 });
61 | List right = new List(new int[] { 4, 12, 16, 4, 27 });
62 |
63 | Assert.Equal(left, right, new CollectionEquivalenceComparer());
64 | }
65 | }
66 |
67 | class CollectionEquivalenceComparer : IEqualityComparer>
68 | where T : IEquatable
69 | {
70 | public bool Equals(IEnumerable x, IEnumerable y)
71 | {
72 | List leftList = new List(x);
73 | List rightList = new List(y);
74 | leftList.Sort();
75 | rightList.Sort();
76 |
77 | IEnumerator enumeratorX = leftList.GetEnumerator();
78 | IEnumerator enumeratorY = rightList.GetEnumerator();
79 |
80 | while (true)
81 | {
82 | bool hasNextX = enumeratorX.MoveNext();
83 | bool hasNextY = enumeratorY.MoveNext();
84 |
85 | if (!hasNextX || !hasNextY)
86 | return (hasNextX == hasNextY);
87 |
88 | if (!enumeratorX.Current.Equals(enumeratorY.Current))
89 | return false;
90 | }
91 | }
92 |
93 | public int GetHashCode(IEnumerable obj)
94 | {
95 | throw new NotImplementedException();
96 | }
97 | }
98 | }
--------------------------------------------------------------------------------
/tests/samples.xunit/AssertExamples/EqualExample.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xunit;
4 |
5 | public class EqualExample
6 | {
7 | [Fact]
8 | public void EqualStringIgnoreCase()
9 | {
10 | string expected = "TestString";
11 | string actual = "teststring";
12 |
13 | Assert.False(actual == expected);
14 | Assert.NotEqual(expected, actual);
15 | Assert.Equal(expected, actual, StringComparer.CurrentCultureIgnoreCase);
16 | }
17 |
18 | class DateComparer : IEqualityComparer
19 | {
20 | public bool Equals(DateTime x, DateTime y)
21 | {
22 | return x.Date == y.Date;
23 | }
24 |
25 | public int GetHashCode(DateTime obj)
26 | {
27 | return obj.GetHashCode();
28 | }
29 | }
30 |
31 | [Fact]
32 | public void DateShouldBeEqualEvenThoughTimesAreDifferent()
33 | {
34 | DateTime firstTime = DateTime.Now.Date;
35 | DateTime later = firstTime.AddMinutes(90);
36 |
37 | Assert.NotEqual(firstTime, later);
38 | Assert.Equal(firstTime, later, new DateComparer());
39 | }
40 | }
--------------------------------------------------------------------------------
/tests/samples.xunit/README.md:
--------------------------------------------------------------------------------
1 | # xUnit Samples
2 |
3 | These samples were borrowed from the xUnit samples project found
4 | [here](https://github.com/xunit/samples.xunit/tree/413e29ab744a354bc26aee2b8748b16d3ef969e6).
5 |
--------------------------------------------------------------------------------
/tests/tests.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.26124.0
5 | MinimumVisualStudioVersion = 15.0.26124.0
6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nunit-csharp-samples", "nunit-csharp-samples", "{C374D84D-1852-4AC9-8218-5E622FFC2303}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "syntax", "nunit-csharp-samples\syntax\syntax.csproj", "{25781B84-A546-49EB-AB3F-2E10677AF089}"
9 | EndProject
10 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "rafaelfgx_DotNetTests", "rafaelfgx_DotNetTests", "{11A57EFE-C63E-4A77-B618-9961888A6AFB}"
11 | EndProject
12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Data", "rafaelfgx_DotNetTests\Data\Data.csproj", "{0E632CA1-2B0A-4DB0-960C-83401E4603F1}"
13 | EndProject
14 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSTest", "rafaelfgx_DotNetTests\MSTest\MSTest.csproj", "{E258F460-FE07-4812-A66D-C018D7B12C25}"
15 | EndProject
16 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples.xunit", "samples.xunit", "{C5C9AA12-600D-4E3E-AEA8-F6FEF9A88A72}"
17 | EndProject
18 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssertExamples", "samples.xunit\AssertExamples\AssertExamples.csproj", "{A62712DD-4853-42EA-A33D-BE150E065A27}"
19 | EndProject
20 | Global
21 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
22 | Debug|Any CPU = Debug|Any CPU
23 | Debug|x64 = Debug|x64
24 | Debug|x86 = Debug|x86
25 | Release|Any CPU = Release|Any CPU
26 | Release|x64 = Release|x64
27 | Release|x86 = Release|x86
28 | EndGlobalSection
29 | GlobalSection(SolutionProperties) = preSolution
30 | HideSolutionNode = FALSE
31 | EndGlobalSection
32 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
33 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Debug|Any CPU.Build.0 = Debug|Any CPU
35 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Debug|x64.ActiveCfg = Debug|Any CPU
36 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Debug|x64.Build.0 = Debug|Any CPU
37 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Debug|x86.ActiveCfg = Debug|Any CPU
38 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Debug|x86.Build.0 = Debug|Any CPU
39 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Release|Any CPU.ActiveCfg = Release|Any CPU
40 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Release|Any CPU.Build.0 = Release|Any CPU
41 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Release|x64.ActiveCfg = Release|Any CPU
42 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Release|x64.Build.0 = Release|Any CPU
43 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Release|x86.ActiveCfg = Release|Any CPU
44 | {25781B84-A546-49EB-AB3F-2E10677AF089}.Release|x86.Build.0 = Release|Any CPU
45 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
46 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
47 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Debug|x64.ActiveCfg = Debug|Any CPU
48 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Debug|x64.Build.0 = Debug|Any CPU
49 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Debug|x86.ActiveCfg = Debug|Any CPU
50 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Debug|x86.Build.0 = Debug|Any CPU
51 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
52 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Release|Any CPU.Build.0 = Release|Any CPU
53 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Release|x64.ActiveCfg = Release|Any CPU
54 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Release|x64.Build.0 = Release|Any CPU
55 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Release|x86.ActiveCfg = Release|Any CPU
56 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1}.Release|x86.Build.0 = Release|Any CPU
57 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
58 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Debug|Any CPU.Build.0 = Debug|Any CPU
59 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Debug|x64.ActiveCfg = Debug|Any CPU
60 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Debug|x64.Build.0 = Debug|Any CPU
61 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Debug|x86.ActiveCfg = Debug|Any CPU
62 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Debug|x86.Build.0 = Debug|Any CPU
63 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Release|Any CPU.ActiveCfg = Release|Any CPU
64 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Release|Any CPU.Build.0 = Release|Any CPU
65 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Release|x64.ActiveCfg = Release|Any CPU
66 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Release|x64.Build.0 = Release|Any CPU
67 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Release|x86.ActiveCfg = Release|Any CPU
68 | {E258F460-FE07-4812-A66D-C018D7B12C25}.Release|x86.Build.0 = Release|Any CPU
69 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
70 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Debug|Any CPU.Build.0 = Debug|Any CPU
71 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Debug|x64.ActiveCfg = Debug|Any CPU
72 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Debug|x64.Build.0 = Debug|Any CPU
73 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Debug|x86.ActiveCfg = Debug|Any CPU
74 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Debug|x86.Build.0 = Debug|Any CPU
75 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Release|Any CPU.ActiveCfg = Release|Any CPU
76 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Release|Any CPU.Build.0 = Release|Any CPU
77 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Release|x64.ActiveCfg = Release|Any CPU
78 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Release|x64.Build.0 = Release|Any CPU
79 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Release|x86.ActiveCfg = Release|Any CPU
80 | {A62712DD-4853-42EA-A33D-BE150E065A27}.Release|x86.Build.0 = Release|Any CPU
81 | EndGlobalSection
82 | GlobalSection(NestedProjects) = preSolution
83 | {25781B84-A546-49EB-AB3F-2E10677AF089} = {C374D84D-1852-4AC9-8218-5E622FFC2303}
84 | {0E632CA1-2B0A-4DB0-960C-83401E4603F1} = {11A57EFE-C63E-4A77-B618-9961888A6AFB}
85 | {E258F460-FE07-4812-A66D-C018D7B12C25} = {11A57EFE-C63E-4A77-B618-9961888A6AFB}
86 | {A62712DD-4853-42EA-A33D-BE150E065A27} = {C5C9AA12-600D-4E3E-AEA8-F6FEF9A88A72}
87 | EndGlobalSection
88 | EndGlobal
89 |
--------------------------------------------------------------------------------
/trx-report/sample-test-results.ps1:
--------------------------------------------------------------------------------
1 |
2 | #$xslFile = "$PSScriptRoot\example.xsl"
3 | #$xmlFile = "$PSScriptRoot\example.xml"
4 | #$outFile = "$PSScriptRoot\example.out"
5 |
6 | $xslFile = "$PSScriptRoot\trx2md.xsl"
7 | $xmlFile = "$PSScriptRoot\sample-test-results.trx"
8 | $outFile = "$PSScriptRoot\sample-test.results.md"
9 |
10 | class TrxFn {
11 | [double]DiffSeconds([datetime]$from, [datetime]$till) {
12 | return ($till - $from).TotalSeconds
13 | }
14 | }
15 |
16 |
17 | if (-not $script:xslt) {
18 | $script:urlr = [System.Xml.XmlUrlResolver]::new()
19 | $script:opts = [System.Xml.Xsl.XsltSettings]::new()
20 | #$script:opts.EnableScript = $true
21 | $script:xslt = [System.Xml.Xsl.XslCompiledTransform]::new()
22 | try {
23 | $script:xslt.Load($xslFile, $script:opts, $script:urlr)
24 | }
25 | catch {
26 | $Error[0]
27 | return
28 | }
29 | }
30 |
31 | $script:list = [System.Xml.Xsl.XsltArgumentList]::new()
32 | $script:list.AddExtensionObject("urn:trxfn", [TrxFn]::new())
33 | $script:wrtr = [System.IO.StreamWriter]::new($outFile)
34 | try {
35 | $script:xslt.Transform(
36 | [string]$xmlFile,
37 | [System.Xml.Xsl.XsltArgumentList]$script:list,
38 | [System.IO.TextWriter]$script:wrtr)
39 | }
40 | finally {
41 | $script:wrtr.Dispose()
42 | }
43 |
--------------------------------------------------------------------------------
/trx-report/sample-test.results.md:
--------------------------------------------------------------------------------
1 |
2 | # Test Results - ebekker@EZS-001388 2020-08-04 23:30:03
3 |
4 | Expand the following summaries for more details:
5 |
6 |
7 | Duration: 88.3100095 seconds
8 |
9 |
10 | | **Times** | |
11 | |--|--|
12 | | **Started:** | `2020-08-04T23:29:43.8676181-04:00` |
13 | | **Creation:** | `2020-08-04T23:30:03.6997384-04:00`
14 | | **Queuing:** | `2020-08-04T23:30:03.6997404-04:00`
15 | | **Finished:** | `2020-08-04T23:31:12.1776276-04:00` |
16 | | **Duration:** | `88.3100095` seconds |
17 |
18 |
19 |
20 |
21 | Outcome: Failed | Total: 48 | Passed: 47 | Failed: 1
22 |
23 |
24 | | **Counters** | |
25 | |--|--|
26 | | **Total:** | 48 |
27 | | **Executed:** | 48 |
28 | | **Passed:** | 47 |
29 | | **Failed:** | 1 |
30 | | **Error:** | 0 |
31 | | **Timeout:** | 0 |
32 | | **Aborted:** | 0 |
33 | | **Inconclusive:** | 0 |
34 | | **PassedButRunAborted:** | 0 |
35 | | **NotRunnable:** | 0 |
36 | | **NotExecuted:** | 0 |
37 | | **Disconnected:** | 0 |
38 | | **Warning:** | 0 |
39 | | **Completed:** | 0 |
40 | | **InProgress:** | 0 |
41 | | **Pending:** | 0 |
42 |
43 |
44 |
45 | ## Tests:
46 |
47 |
48 |
49 |
50 |
51 | :heavy_check_mark: CreateEcdsaKeyPair (224)
52 |
53 |
54 | | | |
55 | |-|-|
56 | | **ID:** | `ab4e7bb2-7bfa-465b-9435-178752a4c8b1`
57 | | **Name:** | `CreateEcdsaKeyPair (224)`
58 | | **Outcome:** | `Passed` :heavy_check_mark:
59 | | **Computer Name:** | `EZS-001388`
60 | | **Start:** | `2020-08-04T23:31:10.9706166-04:00`
61 | | **End:** | `2020-08-04T23:31:11.7797698-04:00`
62 | | **Duration:** | `00:00:00.2997058`
63 |
64 |
65 | Test Method Details:
66 |
67 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
68 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
69 | * Method Name: `CreateEcdsaKeyPair`
70 |
71 |
72 |
73 |
74 |
75 |
76 | -----
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 | :heavy_check_mark: ExportSelfSignedPkcs12 (Ecdsa,256)
85 |
86 |
87 | | | |
88 | |-|-|
89 | | **ID:** | `037d9409-ded7-49d8-857f-3c99cdf0ebba`
90 | | **Name:** | `ExportSelfSignedPkcs12 (Ecdsa,256)`
91 | | **Outcome:** | `Passed` :heavy_check_mark:
92 | | **Computer Name:** | `EZS-001388`
93 | | **Start:** | `2020-08-04T23:30:29.6632242-04:00`
94 | | **End:** | `2020-08-04T23:30:30.7225185-04:00`
95 | | **Duration:** | `00:00:00.4795390`
96 |
97 |
98 | Test Method Details:
99 |
100 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
101 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
102 | * Method Name: `ExportSelfSignedPkcs12`
103 |
104 |
105 |
106 |
107 |
108 |
109 | -----
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 | :heavy_check_mark: CreateAndExportRsaSansCsr (4096,Sha256)
118 |
119 |
120 | | | |
121 | |-|-|
122 | | **ID:** | `94dd0282-4407-46d1-b93c-fbaa10c47189`
123 | | **Name:** | `CreateAndExportRsaSansCsr (4096,Sha256)`
124 | | **Outcome:** | `Passed` :heavy_check_mark:
125 | | **Computer Name:** | `EZS-001388`
126 | | **Start:** | `2020-08-04T23:30:03.6535850-04:00`
127 | | **End:** | `2020-08-04T23:30:16.2482461-04:00`
128 | | **Duration:** | `00:00:04.1093388`
129 |
130 |
131 | Test Method Details:
132 |
133 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
134 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
135 | * Method Name: `CreateAndExportRsaSansCsr`
136 |
137 |
138 |
139 |
140 |
141 |
142 | -----
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 | :heavy_check_mark: CreateEcdsaKeyPair (256)
151 |
152 |
153 | | | |
154 | |-|-|
155 | | **ID:** | `efcb2dfa-5d92-45d8-98d3-d7b0f3f4a806`
156 | | **Name:** | `CreateEcdsaKeyPair (256)`
157 | | **Outcome:** | `Passed` :heavy_check_mark:
158 | | **Computer Name:** | `EZS-001388`
159 | | **Start:** | `2020-08-04T23:31:10.9706166-04:00`
160 | | **End:** | `2020-08-04T23:31:11.7797698-04:00`
161 | | **Duration:** | `00:00:00.2581378`
162 |
163 |
164 | Test Method Details:
165 |
166 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
167 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
168 | * Method Name: `CreateEcdsaKeyPair`
169 |
170 |
171 |
172 |
173 |
174 |
175 | -----
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 | :heavy_check_mark: ExportSignedCert (Ecdsa,256)
184 |
185 |
186 | | | |
187 | |-|-|
188 | | **ID:** | `2531ebc6-9824-4429-b166-6da51d74e175`
189 | | **Name:** | `ExportSignedCert (Ecdsa,256)`
190 | | **Outcome:** | `Passed` :heavy_check_mark:
191 | | **Computer Name:** | `EZS-001388`
192 | | **Start:** | `2020-08-04T23:30:27.9431420-04:00`
193 | | **End:** | `2020-08-04T23:30:29.6631942-04:00`
194 | | **Duration:** | `00:00:00.3665812`
195 |
196 |
197 | Test Method Details:
198 |
199 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
200 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
201 | * Method Name: `ExportSignedCert`
202 |
203 |
204 |
205 |
206 |
207 |
208 | -----
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 | :heavy_check_mark: CreateAndExportEcdsaSansCsr (256,Sha256)
217 |
218 |
219 | | | |
220 | |-|-|
221 | | **ID:** | `8e2fc936-5e6f-4909-a99f-cd178f3c192a`
222 | | **Name:** | `CreateAndExportEcdsaSansCsr (256,Sha256)`
223 | | **Outcome:** | `Passed` :heavy_check_mark:
224 | | **Computer Name:** | `EZS-001388`
225 | | **Start:** | `2020-08-04T23:30:19.0715580-04:00`
226 | | **End:** | `2020-08-04T23:30:21.6233278-04:00`
227 | | **Duration:** | `00:00:00.3648858`
228 |
229 |
230 | Test Method Details:
231 |
232 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
233 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
234 | * Method Name: `CreateAndExportEcdsaSansCsr`
235 |
236 |
237 |
238 |
239 |
240 |
241 | -----
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 | :heavy_check_mark: CreateAndExportRsaCsr (4096,Sha512)
250 |
251 |
252 | | | |
253 | |-|-|
254 | | **ID:** | `fcf97049-5e0f-4f48-9b71-1ad19ec5eedb`
255 | | **Name:** | `CreateAndExportRsaCsr (4096,Sha512)`
256 | | **Outcome:** | `Passed` :heavy_check_mark:
257 | | **Computer Name:** | `EZS-001388`
258 | | **Start:** | `2020-08-04T23:29:45.3574617-04:00`
259 | | **End:** | `2020-08-04T23:30:03.6204783-04:00`
260 | | **Duration:** | `00:00:05.0348594`
261 |
262 |
263 | Test Method Details:
264 |
265 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
266 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
267 | * Method Name: `CreateAndExportRsaCsr`
268 |
269 |
270 |
271 |
272 |
273 |
274 | -----
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 | :heavy_check_mark: ExportSignedPkcs12 (Ecdsa,256)
283 |
284 |
285 | | | |
286 | |-|-|
287 | | **ID:** | `e1bce511-b519-434a-9bf3-90c643e1bb15`
288 | | **Name:** | `ExportSignedPkcs12 (Ecdsa,256)`
289 | | **Outcome:** | `Passed` :heavy_check_mark:
290 | | **Computer Name:** | `EZS-001388`
291 | | **Start:** | `2020-08-04T23:30:30.7225755-04:00`
292 | | **End:** | `2020-08-04T23:30:33.2291652-04:00`
293 | | **Duration:** | `00:00:00.3995436`
294 |
295 |
296 | Test Method Details:
297 |
298 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
299 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
300 | * Method Name: `ExportSignedPkcs12`
301 |
302 |
303 |
304 |
305 |
306 |
307 | -----
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 | :heavy_check_mark: CreateAndExportEcdsaSansCsr (384,Sha512)
316 |
317 |
318 | | | |
319 | |-|-|
320 | | **ID:** | `c6a73f80-03a4-405d-83f6-3b64d3359af6`
321 | | **Name:** | `CreateAndExportEcdsaSansCsr (384,Sha512)`
322 | | **Outcome:** | `Passed` :heavy_check_mark:
323 | | **Computer Name:** | `EZS-001388`
324 | | **Start:** | `2020-08-04T23:30:19.0715580-04:00`
325 | | **End:** | `2020-08-04T23:30:21.6233278-04:00`
326 | | **Duration:** | `00:00:00.5273155`
327 |
328 |
329 | Test Method Details:
330 |
331 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
332 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
333 | * Method Name: `CreateAndExportEcdsaSansCsr`
334 |
335 |
336 |
337 |
338 |
339 |
340 | -----
341 |
342 |
343 |
344 |
345 |
346 |
347 |
348 | :heavy_check_mark: CreateAndExportRsaSansCsr (2048,Sha256)
349 |
350 |
351 | | | |
352 | |-|-|
353 | | **ID:** | `186dfbe0-9400-440a-a94b-1b12c10381f2`
354 | | **Name:** | `CreateAndExportRsaSansCsr (2048,Sha256)`
355 | | **Outcome:** | `Passed` :heavy_check_mark:
356 | | **Computer Name:** | `EZS-001388`
357 | | **Start:** | `2020-08-04T23:30:03.6535850-04:00`
358 | | **End:** | `2020-08-04T23:30:16.2482461-04:00`
359 | | **Duration:** | `00:00:02.3072033`
360 |
361 |
362 | Test Method Details:
363 |
364 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
365 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
366 | * Method Name: `CreateAndExportRsaSansCsr`
367 |
368 |
369 |
370 |
371 |
372 |
373 | -----
374 |
375 |
376 |
377 |
378 |
379 |
380 |
381 | :heavy_check_mark: ExportRsaKeyPairWithPassword (2048)
382 |
383 |
384 | | | |
385 | |-|-|
386 | | **ID:** | `693ace13-9c71-49f3-944c-1a5696f410d3`
387 | | **Name:** | `ExportRsaKeyPairWithPassword (2048)`
388 | | **Outcome:** | `Passed` :heavy_check_mark:
389 | | **Computer Name:** | `EZS-001388`
390 | | **Start:** | `2020-08-04T23:31:10.1816531-04:00`
391 | | **End:** | `2020-08-04T23:31:10.9705875-04:00`
392 | | **Duration:** | `00:00:00.7886831`
393 |
394 |
395 | Test Method Details:
396 |
397 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
398 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
399 | * Method Name: `ExportRsaKeyPairWithPassword`
400 |
401 |
402 |
403 |
404 |
405 |
406 | -----
407 |
408 |
409 |
410 |
411 |
412 |
413 |
414 | :heavy_check_mark: CreateAndExportEcdsaCsr (384,Sha256)
415 |
416 |
417 | | | |
418 | |-|-|
419 | | **ID:** | `47f44031-ef62-4da7-92d9-69fc40cd7770`
420 | | **Name:** | `CreateAndExportEcdsaCsr (384,Sha256)`
421 | | **Outcome:** | `Passed` :heavy_check_mark:
422 | | **Computer Name:** | `EZS-001388`
423 | | **Start:** | `2020-08-04T23:30:16.2494142-04:00`
424 | | **End:** | `2020-08-04T23:30:19.0708741-04:00`
425 | | **Duration:** | `00:00:00.5552387`
426 |
427 |
428 | Test Method Details:
429 |
430 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
431 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
432 | * Method Name: `CreateAndExportEcdsaCsr`
433 |
434 |
435 |
436 |
437 |
438 |
439 | -----
440 |
441 |
442 |
443 |
444 |
445 |
446 |
447 | :heavy_check_mark: CreateAndExportRsaCsr (2048,Sha512)
448 |
449 |
450 | | | |
451 | |-|-|
452 | | **ID:** | `9bf3eb06-38c8-4724-8042-5af34847b647`
453 | | **Name:** | `CreateAndExportRsaCsr (2048,Sha512)`
454 | | **Outcome:** | `Passed` :heavy_check_mark:
455 | | **Computer Name:** | `EZS-001388`
456 | | **Start:** | `2020-08-04T23:29:45.3574617-04:00`
457 | | **End:** | `2020-08-04T23:30:03.6204783-04:00`
458 | | **Duration:** | `00:00:00.7916418`
459 |
460 |
461 | Test Method Details:
462 |
463 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
464 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
465 | * Method Name: `CreateAndExportRsaCsr`
466 |
467 |
468 |
469 |
470 |
471 |
472 | -----
473 |
474 |
475 |
476 |
477 |
478 |
479 |
480 | :heavy_check_mark: CreateAndExportEcdsaCsr (256,Sha256)
481 |
482 |
483 | | | |
484 | |-|-|
485 | | **ID:** | `9352f570-3c7a-4345-98e1-f6519c2a5bfb`
486 | | **Name:** | `CreateAndExportEcdsaCsr (256,Sha256)`
487 | | **Outcome:** | `Passed` :heavy_check_mark:
488 | | **Computer Name:** | `EZS-001388`
489 | | **Start:** | `2020-08-04T23:30:16.2494142-04:00`
490 | | **End:** | `2020-08-04T23:30:19.0708741-04:00`
491 | | **Duration:** | `00:00:00.4223549`
492 |
493 |
494 | Test Method Details:
495 |
496 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
497 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
498 | * Method Name: `CreateAndExportEcdsaCsr`
499 |
500 |
501 |
502 |
503 |
504 |
505 | -----
506 |
507 |
508 |
509 |
510 |
511 |
512 |
513 | :heavy_check_mark: CreateAndExportEcdsaSansCsr (224,Sha512)
514 |
515 |
516 | | | |
517 | |-|-|
518 | | **ID:** | `7f1644aa-269a-4d1d-92c9-5ef56ed40da0`
519 | | **Name:** | `CreateAndExportEcdsaSansCsr (224,Sha512)`
520 | | **Outcome:** | `Passed` :heavy_check_mark:
521 | | **Computer Name:** | `EZS-001388`
522 | | **Start:** | `2020-08-04T23:30:19.0715580-04:00`
523 | | **End:** | `2020-08-04T23:30:21.6233278-04:00`
524 | | **Duration:** | `00:00:00.3771354`
525 |
526 |
527 | Test Method Details:
528 |
529 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
530 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
531 | * Method Name: `CreateAndExportEcdsaSansCsr`
532 |
533 |
534 |
535 |
536 |
537 |
538 | -----
539 |
540 |
541 |
542 |
543 |
544 |
545 |
546 | :heavy_check_mark: CreateRsaKeyPair (1024)
547 |
548 |
549 | | | |
550 | |-|-|
551 | | **ID:** | `5ac7a0f5-de23-4bc9-896e-7b77a8c5e3eb`
552 | | **Name:** | `CreateRsaKeyPair (1024)`
553 | | **Outcome:** | `Passed` :heavy_check_mark:
554 | | **Computer Name:** | `EZS-001388`
555 | | **Start:** | `2020-08-04T23:30:37.8551722-04:00`
556 | | **End:** | `2020-08-04T23:31:10.1809310-04:00`
557 | | **Duration:** | `00:00:00.5095741`
558 |
559 |
560 | Test Method Details:
561 |
562 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
563 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
564 | * Method Name: `CreateRsaKeyPair`
565 |
566 |
567 |
568 |
569 |
570 |
571 | -----
572 |
573 |
574 |
575 |
576 |
577 |
578 |
579 | :heavy_check_mark: SaveLoadCertificate (Rsa,2048)
580 |
581 |
582 | | | |
583 | |-|-|
584 | | **ID:** | `70f6b58d-f7da-420a-ad42-9a96f23c1a68`
585 | | **Name:** | `SaveLoadCertificate (Rsa,2048)`
586 | | **Outcome:** | `Passed` :heavy_check_mark:
587 | | **Computer Name:** | `EZS-001388`
588 | | **Start:** | `2020-08-04T23:30:35.6874402-04:00`
589 | | **End:** | `2020-08-04T23:30:37.8545586-04:00`
590 | | **Duration:** | `00:00:02.1580375`
591 |
592 |
593 | Test Method Details:
594 |
595 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
596 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
597 | * Method Name: `SaveLoadCertificate`
598 |
599 |
600 |
601 |
602 |
603 |
604 | -----
605 |
606 |
607 |
608 |
609 |
610 |
611 |
612 | :heavy_check_mark: ExportSignedPkcs12 (Rsa,2048)
613 |
614 |
615 | | | |
616 | |-|-|
617 | | **ID:** | `9a291bd0-6673-4616-ba2a-41bfee4fa3e1`
618 | | **Name:** | `ExportSignedPkcs12 (Rsa,2048)`
619 | | **Outcome:** | `Passed` :heavy_check_mark:
620 | | **Computer Name:** | `EZS-001388`
621 | | **Start:** | `2020-08-04T23:30:30.7225755-04:00`
622 | | **End:** | `2020-08-04T23:30:33.2291652-04:00`
623 | | **Duration:** | `00:00:02.1064399`
624 |
625 |
626 | Test Method Details:
627 |
628 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
629 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
630 | * Method Name: `ExportSignedPkcs12`
631 |
632 |
633 |
634 |
635 |
636 |
637 | -----
638 |
639 |
640 |
641 |
642 |
643 |
644 |
645 | :heavy_check_mark: CreateAndExportEcdsaSansCsr (384,Sha256)
646 |
647 |
648 | | | |
649 | |-|-|
650 | | **ID:** | `702f7db5-07bd-46c1-81e4-4b50f705f379`
651 | | **Name:** | `CreateAndExportEcdsaSansCsr (384,Sha256)`
652 | | **Outcome:** | `Passed` :heavy_check_mark:
653 | | **Computer Name:** | `EZS-001388`
654 | | **Start:** | `2020-08-04T23:30:19.0715580-04:00`
655 | | **End:** | `2020-08-04T23:30:21.6233278-04:00`
656 | | **Duration:** | `00:00:00.4069213`
657 |
658 |
659 | Test Method Details:
660 |
661 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
662 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
663 | * Method Name: `CreateAndExportEcdsaSansCsr`
664 |
665 |
666 |
667 |
668 |
669 |
670 | -----
671 |
672 |
673 |
674 |
675 |
676 |
677 |
678 | :heavy_check_mark: CreateAndExportRsaCsr (4096,Sha256)
679 |
680 |
681 | | | |
682 | |-|-|
683 | | **ID:** | `6b407dec-4dd8-4dda-a88e-25ff1d325062`
684 | | **Name:** | `CreateAndExportRsaCsr (4096,Sha256)`
685 | | **Outcome:** | `Passed` :heavy_check_mark:
686 | | **Computer Name:** | `EZS-001388`
687 | | **Start:** | `2020-08-04T23:29:45.3574617-04:00`
688 | | **End:** | `2020-08-04T23:30:03.6204783-04:00`
689 | | **Duration:** | `00:00:09.6932983`
690 |
691 |
692 | Test Method Details:
693 |
694 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
695 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
696 | * Method Name: `CreateAndExportRsaCsr`
697 |
698 |
699 |
700 |
701 |
702 |
703 | -----
704 |
705 |
706 |
707 |
708 |
709 |
710 |
711 | :heavy_check_mark: ExportSelfSignedPemChain (Ecdsa,256)
712 |
713 |
714 | | | |
715 | |-|-|
716 | | **ID:** | `a04083ca-fbd5-41cd-9f4f-7bc0492fc97c`
717 | | **Name:** | `ExportSelfSignedPemChain (Ecdsa,256)`
718 | | **Outcome:** | `Passed` :heavy_check_mark:
719 | | **Computer Name:** | `EZS-001388`
720 | | **Start:** | `2020-08-04T23:30:33.2299417-04:00`
721 | | **End:** | `2020-08-04T23:30:35.6868366-04:00`
722 | | **Duration:** | `00:00:00.8458158`
723 |
724 |
725 | Test Method Details:
726 |
727 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
728 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
729 | * Method Name: `ExportSelfSignedPemChain`
730 |
731 |
732 |
733 |
734 |
735 |
736 | -----
737 |
738 |
739 |
740 |
741 |
742 |
743 |
744 | :heavy_check_mark: CreateAndExportRsaSansCsr (4096,Sha512)
745 |
746 |
747 | | | |
748 | |-|-|
749 | | **ID:** | `60521eae-8846-4272-a4e2-aacff4686061`
750 | | **Name:** | `CreateAndExportRsaSansCsr (4096,Sha512)`
751 | | **Outcome:** | `Passed` :heavy_check_mark:
752 | | **Computer Name:** | `EZS-001388`
753 | | **Start:** | `2020-08-04T23:30:03.6535850-04:00`
754 | | **End:** | `2020-08-04T23:30:16.2482461-04:00`
755 | | **Duration:** | `00:00:04.3416540`
756 |
757 |
758 | Test Method Details:
759 |
760 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
761 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
762 | * Method Name: `CreateAndExportRsaSansCsr`
763 |
764 |
765 |
766 |
767 |
768 |
769 | -----
770 |
771 |
772 |
773 |
774 |
775 |
776 |
777 | :heavy_check_mark: CreateAndExportRsaCsr (2048,Sha256)
778 |
779 |
780 | | | |
781 | |-|-|
782 | | **ID:** | `bf949c0b-7e25-429c-859d-bdb01bf9c829`
783 | | **Name:** | `CreateAndExportRsaCsr (2048,Sha256)`
784 | | **Outcome:** | `Passed` :heavy_check_mark:
785 | | **Computer Name:** | `EZS-001388`
786 | | **Start:** | `2020-08-04T23:29:45.3574617-04:00`
787 | | **End:** | `2020-08-04T23:30:03.6204783-04:00`
788 | | **Duration:** | `00:00:01.2476606`
789 |
790 |
791 | Test Method Details:
792 |
793 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
794 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
795 | * Method Name: `CreateAndExportRsaCsr`
796 |
797 |
798 |
799 |
800 |
801 |
802 | -----
803 |
804 |
805 |
806 |
807 |
808 |
809 |
810 | :x: ExportImportCsr (Rsa,2048,Der)
811 |
812 |
813 | | | |
814 | |-|-|
815 | | **ID:** | `76b92b9a-1cda-44f3-802b-7685c34dd81e`
816 | | **Name:** | `ExportImportCsr (Rsa,2048,Der)`
817 | | **Outcome:** | `Failed` :x:
818 | | **Computer Name:** | `EZS-001388`
819 | | **Start:** | `2020-08-04T23:30:25.3829116-04:00`
820 | | **End:** | `2020-08-04T23:30:26.7480874-04:00`
821 | | **Duration:** | `00:00:01.3644040`
822 |
823 |
824 | Test Method Details:
825 |
826 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
827 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
828 | * Method Name: `ExportImportCsr`
829 |
830 |
831 |
832 |
833 |
834 |
835 |
836 | Error Message:
837 |
838 | ```text
839 | Assert.AreNotEqual failed. Expected any value except:. Actual:.
840 | ```
841 |
842 |
843 |
844 | Error Stack Trace:
845 |
846 | ```text
847 | at PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests.ExportImportCsr(PkiAsymmetricAlgorithm algor, Int32 bits, PkiEncodingFormat format) in C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\PkiCertificateSigningRequestTests.cs:line 284
848 |
849 | ```
850 |
851 |
852 |
853 |
854 | -----
855 |
856 |
857 |
858 |
859 |
860 |
861 |
862 | :heavy_check_mark: CreateAndExportRsaCsr (1024,Sha512)
863 |
864 |
865 | | | |
866 | |-|-|
867 | | **ID:** | `8897c686-a956-40c6-8ec5-6a88c445eb1a`
868 | | **Name:** | `CreateAndExportRsaCsr (1024,Sha512)`
869 | | **Outcome:** | `Passed` :heavy_check_mark:
870 | | **Computer Name:** | `EZS-001388`
871 | | **Start:** | `2020-08-04T23:29:45.3574617-04:00`
872 | | **End:** | `2020-08-04T23:30:03.6204783-04:00`
873 | | **Duration:** | `00:00:00.4957368`
874 |
875 |
876 | Test Method Details:
877 |
878 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
879 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
880 | * Method Name: `CreateAndExportRsaCsr`
881 |
882 |
883 |
884 |
885 |
886 |
887 | -----
888 |
889 |
890 |
891 |
892 |
893 |
894 |
895 | :heavy_check_mark: ExportSelfSignedCert (Rsa,2048)
896 |
897 |
898 | | | |
899 | |-|-|
900 | | **ID:** | `9296c42e-1194-4a29-9e4f-0b24473f8f39`
901 | | **Name:** | `ExportSelfSignedCert (Rsa,2048)`
902 | | **Outcome:** | `Passed` :heavy_check_mark:
903 | | **Computer Name:** | `EZS-001388`
904 | | **Start:** | `2020-08-04T23:30:26.7481181-04:00`
905 | | **End:** | `2020-08-04T23:30:27.9431148-04:00`
906 | | **Duration:** | `00:00:00.8173371`
907 |
908 |
909 | Test Method Details:
910 |
911 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
912 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
913 | * Method Name: `ExportSelfSignedCert`
914 |
915 |
916 |
917 |
918 |
919 |
920 | -----
921 |
922 |
923 |
924 |
925 |
926 |
927 |
928 | :heavy_check_mark: CreateAndExportEcdsaCsr (256,Sha512)
929 |
930 |
931 | | | |
932 | |-|-|
933 | | **ID:** | `dc65c16c-18ca-4672-9f65-9e3d1080b1f2`
934 | | **Name:** | `CreateAndExportEcdsaCsr (256,Sha512)`
935 | | **Outcome:** | `Passed` :heavy_check_mark:
936 | | **Computer Name:** | `EZS-001388`
937 | | **Start:** | `2020-08-04T23:30:16.2494142-04:00`
938 | | **End:** | `2020-08-04T23:30:19.0708741-04:00`
939 | | **Duration:** | `00:00:00.4434356`
940 |
941 |
942 | Test Method Details:
943 |
944 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
945 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
946 | * Method Name: `CreateAndExportEcdsaCsr`
947 |
948 |
949 |
950 |
951 |
952 |
953 | -----
954 |
955 |
956 |
957 |
958 |
959 |
960 |
961 | :heavy_check_mark: ExportSelfSignedPemChain (Rsa,2048)
962 |
963 |
964 | | | |
965 | |-|-|
966 | | **ID:** | `f0911e9a-2955-46e9-874c-d922b36a0be9`
967 | | **Name:** | `ExportSelfSignedPemChain (Rsa,2048)`
968 | | **Outcome:** | `Passed` :heavy_check_mark:
969 | | **Computer Name:** | `EZS-001388`
970 | | **Start:** | `2020-08-04T23:30:33.2299417-04:00`
971 | | **End:** | `2020-08-04T23:30:35.6868366-04:00`
972 | | **Duration:** | `00:00:01.6105963`
973 |
974 |
975 | Test Method Details:
976 |
977 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
978 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
979 | * Method Name: `ExportSelfSignedPemChain`
980 |
981 |
982 |
983 |
984 |
985 |
986 | -----
987 |
988 |
989 |
990 |
991 |
992 |
993 |
994 | :heavy_check_mark: CreateAndExportRsaCsr (1024,Sha256)
995 |
996 |
997 | | | |
998 | |-|-|
999 | | **ID:** | `fe68af98-7434-43be-88bb-81179b163819`
1000 | | **Name:** | `CreateAndExportRsaCsr (1024,Sha256)`
1001 | | **Outcome:** | `Passed` :heavy_check_mark:
1002 | | **Computer Name:** | `EZS-001388`
1003 | | **Start:** | `2020-08-04T23:29:45.3574617-04:00`
1004 | | **End:** | `2020-08-04T23:30:03.6204783-04:00`
1005 | | **Duration:** | `00:00:00.9421907`
1006 |
1007 |
1008 | Test Method Details:
1009 |
1010 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1011 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1012 | * Method Name: `CreateAndExportRsaCsr`
1013 |
1014 |
1015 |
1016 |
1017 |
1018 |
1019 | -----
1020 |
1021 |
1022 |
1023 |
1024 |
1025 |
1026 |
1027 | :heavy_check_mark: CreateRsaKeyPair (4096)
1028 |
1029 |
1030 | | | |
1031 | |-|-|
1032 | | **ID:** | `440757a0-fc4c-4d3c-971f-11f34cab5bb2`
1033 | | **Name:** | `CreateRsaKeyPair (4096)`
1034 | | **Outcome:** | `Passed` :heavy_check_mark:
1035 | | **Computer Name:** | `EZS-001388`
1036 | | **Start:** | `2020-08-04T23:30:37.8551722-04:00`
1037 | | **End:** | `2020-08-04T23:31:10.1809310-04:00`
1038 | | **Duration:** | `00:00:30.6288364`
1039 |
1040 |
1041 | Test Method Details:
1042 |
1043 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1044 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
1045 | * Method Name: `CreateRsaKeyPair`
1046 |
1047 |
1048 |
1049 |
1050 |
1051 |
1052 | -----
1053 |
1054 |
1055 |
1056 |
1057 |
1058 |
1059 |
1060 | :heavy_check_mark: CreateAndExportEcdsaSansCsr (256,Sha512)
1061 |
1062 |
1063 | | | |
1064 | |-|-|
1065 | | **ID:** | `9ca225d9-7599-4fe9-8fe9-16bf49f7451e`
1066 | | **Name:** | `CreateAndExportEcdsaSansCsr (256,Sha512)`
1067 | | **Outcome:** | `Passed` :heavy_check_mark:
1068 | | **Computer Name:** | `EZS-001388`
1069 | | **Start:** | `2020-08-04T23:30:19.0715580-04:00`
1070 | | **End:** | `2020-08-04T23:30:21.6233278-04:00`
1071 | | **Duration:** | `00:00:00.4675894`
1072 |
1073 |
1074 | Test Method Details:
1075 |
1076 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1077 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1078 | * Method Name: `CreateAndExportEcdsaSansCsr`
1079 |
1080 |
1081 |
1082 |
1083 |
1084 |
1085 | -----
1086 |
1087 |
1088 |
1089 |
1090 |
1091 |
1092 |
1093 | :heavy_check_mark: ExportSignedCert (Rsa,2048)
1094 |
1095 |
1096 | | | |
1097 | |-|-|
1098 | | **ID:** | `06b2dad4-51e3-41ec-982d-b74a46bd4875`
1099 | | **Name:** | `ExportSignedCert (Rsa,2048)`
1100 | | **Outcome:** | `Passed` :heavy_check_mark:
1101 | | **Computer Name:** | `EZS-001388`
1102 | | **Start:** | `2020-08-04T23:30:27.9431420-04:00`
1103 | | **End:** | `2020-08-04T23:30:29.6631942-04:00`
1104 | | **Duration:** | `00:00:01.3532194`
1105 |
1106 |
1107 | Test Method Details:
1108 |
1109 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1110 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
1111 | * Method Name: `ExportSignedCert`
1112 |
1113 |
1114 |
1115 |
1116 |
1117 |
1118 | -----
1119 |
1120 |
1121 |
1122 |
1123 |
1124 |
1125 |
1126 | :heavy_check_mark: CreateAndExportEcdsaSansCsr (224,Sha256)
1127 |
1128 |
1129 | | | |
1130 | |-|-|
1131 | | **ID:** | `31ebc06a-5d9c-4ced-a2ed-92619d921fe7`
1132 | | **Name:** | `CreateAndExportEcdsaSansCsr (224,Sha256)`
1133 | | **Outcome:** | `Passed` :heavy_check_mark:
1134 | | **Computer Name:** | `EZS-001388`
1135 | | **Start:** | `2020-08-04T23:30:19.0715580-04:00`
1136 | | **End:** | `2020-08-04T23:30:21.6233278-04:00`
1137 | | **Duration:** | `00:00:00.4074769`
1138 |
1139 |
1140 | Test Method Details:
1141 |
1142 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1143 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1144 | * Method Name: `CreateAndExportEcdsaSansCsr`
1145 |
1146 |
1147 |
1148 |
1149 |
1150 |
1151 | -----
1152 |
1153 |
1154 |
1155 |
1156 |
1157 |
1158 |
1159 | :heavy_check_mark: CreateAndExportEcdsaCsr (224,Sha512)
1160 |
1161 |
1162 | | | |
1163 | |-|-|
1164 | | **ID:** | `89bcb7a5-4457-4b9f-b2d9-bb6979d6744f`
1165 | | **Name:** | `CreateAndExportEcdsaCsr (224,Sha512)`
1166 | | **Outcome:** | `Passed` :heavy_check_mark:
1167 | | **Computer Name:** | `EZS-001388`
1168 | | **Start:** | `2020-08-04T23:30:16.2494142-04:00`
1169 | | **End:** | `2020-08-04T23:30:19.0708741-04:00`
1170 | | **Duration:** | `00:00:00.4055914`
1171 |
1172 |
1173 | Test Method Details:
1174 |
1175 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1176 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1177 | * Method Name: `CreateAndExportEcdsaCsr`
1178 |
1179 |
1180 |
1181 |
1182 |
1183 |
1184 | -----
1185 |
1186 |
1187 |
1188 |
1189 |
1190 |
1191 |
1192 | :heavy_check_mark: CreateAndExportRsaSansCsr (1024,Sha512)
1193 |
1194 |
1195 | | | |
1196 | |-|-|
1197 | | **ID:** | `30589b97-6598-4f2b-9f96-451994156302`
1198 | | **Name:** | `CreateAndExportRsaSansCsr (1024,Sha512)`
1199 | | **Outcome:** | `Passed` :heavy_check_mark:
1200 | | **Computer Name:** | `EZS-001388`
1201 | | **Start:** | `2020-08-04T23:30:03.6535850-04:00`
1202 | | **End:** | `2020-08-04T23:30:16.2482461-04:00`
1203 | | **Duration:** | `00:00:00.4364699`
1204 |
1205 |
1206 | Test Method Details:
1207 |
1208 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1209 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1210 | * Method Name: `CreateAndExportRsaSansCsr`
1211 |
1212 |
1213 |
1214 |
1215 |
1216 |
1217 | -----
1218 |
1219 |
1220 |
1221 |
1222 |
1223 |
1224 |
1225 | :heavy_check_mark: SaveLoadCsr (Ecdsa,256)
1226 |
1227 |
1228 | | | |
1229 | |-|-|
1230 | | **ID:** | `deb46920-3eb8-45ee-aac7-ff6c04d0c9a5`
1231 | | **Name:** | `SaveLoadCsr (Ecdsa,256)`
1232 | | **Outcome:** | `Passed` :heavy_check_mark:
1233 | | **Computer Name:** | `EZS-001388`
1234 | | **Start:** | `2020-08-04T23:30:21.6240102-04:00`
1235 | | **End:** | `2020-08-04T23:30:25.3791356-04:00`
1236 | | **Duration:** | `00:00:00.0295567`
1237 |
1238 |
1239 | Test Method Details:
1240 |
1241 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1242 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1243 | * Method Name: `SaveLoadCsr`
1244 |
1245 |
1246 |
1247 |
1248 |
1249 |
1250 | -----
1251 |
1252 |
1253 |
1254 |
1255 |
1256 |
1257 |
1258 | :heavy_check_mark: CreateAndExportEcdsaCsr (224,Sha256)
1259 |
1260 |
1261 | | | |
1262 | |-|-|
1263 | | **ID:** | `47d749a7-89ca-4ea2-9eb3-f463ef1f6024`
1264 | | **Name:** | `CreateAndExportEcdsaCsr (224,Sha256)`
1265 | | **Outcome:** | `Passed` :heavy_check_mark:
1266 | | **Computer Name:** | `EZS-001388`
1267 | | **Start:** | `2020-08-04T23:30:16.2494142-04:00`
1268 | | **End:** | `2020-08-04T23:30:19.0708741-04:00`
1269 | | **Duration:** | `00:00:00.4938630`
1270 |
1271 |
1272 | Test Method Details:
1273 |
1274 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1275 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1276 | * Method Name: `CreateAndExportEcdsaCsr`
1277 |
1278 |
1279 |
1280 |
1281 |
1282 |
1283 | -----
1284 |
1285 |
1286 |
1287 |
1288 |
1289 |
1290 |
1291 | :heavy_check_mark: CreateAndExportRsaSansCsr (1024,Sha256)
1292 |
1293 |
1294 | | | |
1295 | |-|-|
1296 | | **ID:** | `7c93592c-9ca4-439e-8567-6114100e6a5f`
1297 | | **Name:** | `CreateAndExportRsaSansCsr (1024,Sha256)`
1298 | | **Outcome:** | `Passed` :heavy_check_mark:
1299 | | **Computer Name:** | `EZS-001388`
1300 | | **Start:** | `2020-08-04T23:30:03.6535850-04:00`
1301 | | **End:** | `2020-08-04T23:30:16.2482461-04:00`
1302 | | **Duration:** | `00:00:00.5107973`
1303 |
1304 |
1305 | Test Method Details:
1306 |
1307 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1308 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1309 | * Method Name: `CreateAndExportRsaSansCsr`
1310 |
1311 |
1312 |
1313 |
1314 |
1315 |
1316 | -----
1317 |
1318 |
1319 |
1320 |
1321 |
1322 |
1323 |
1324 | :heavy_check_mark: CreateEcdsaKeyPair (384)
1325 |
1326 |
1327 | | | |
1328 | |-|-|
1329 | | **ID:** | `f657222c-c000-430b-9273-5bd3e8dc303d`
1330 | | **Name:** | `CreateEcdsaKeyPair (384)`
1331 | | **Outcome:** | `Passed` :heavy_check_mark:
1332 | | **Computer Name:** | `EZS-001388`
1333 | | **Start:** | `2020-08-04T23:31:10.9706166-04:00`
1334 | | **End:** | `2020-08-04T23:31:11.7797698-04:00`
1335 | | **Duration:** | `00:00:00.2510330`
1336 |
1337 |
1338 | Test Method Details:
1339 |
1340 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1341 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
1342 | * Method Name: `CreateEcdsaKeyPair`
1343 |
1344 |
1345 |
1346 |
1347 |
1348 |
1349 | -----
1350 |
1351 |
1352 |
1353 |
1354 |
1355 |
1356 |
1357 | :heavy_check_mark: CreateAndExportEcdsaCsr (384,Sha512)
1358 |
1359 |
1360 | | | |
1361 | |-|-|
1362 | | **ID:** | `ca910876-9f89-4695-b878-3d661ca8fe54`
1363 | | **Name:** | `CreateAndExportEcdsaCsr (384,Sha512)`
1364 | | **Outcome:** | `Passed` :heavy_check_mark:
1365 | | **Computer Name:** | `EZS-001388`
1366 | | **Start:** | `2020-08-04T23:30:16.2494142-04:00`
1367 | | **End:** | `2020-08-04T23:30:19.0708741-04:00`
1368 | | **Duration:** | `00:00:00.5003765`
1369 |
1370 |
1371 | Test Method Details:
1372 |
1373 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1374 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1375 | * Method Name: `CreateAndExportEcdsaCsr`
1376 |
1377 |
1378 |
1379 |
1380 |
1381 |
1382 | -----
1383 |
1384 |
1385 |
1386 |
1387 |
1388 |
1389 |
1390 | :heavy_check_mark: CreateRsaKeyPair (2048)
1391 |
1392 |
1393 | | | |
1394 | |-|-|
1395 | | **ID:** | `eafdf035-7538-445e-abeb-5afc31f72f95`
1396 | | **Name:** | `CreateRsaKeyPair (2048)`
1397 | | **Outcome:** | `Passed` :heavy_check_mark:
1398 | | **Computer Name:** | `EZS-001388`
1399 | | **Start:** | `2020-08-04T23:30:37.8551722-04:00`
1400 | | **End:** | `2020-08-04T23:31:10.1809310-04:00`
1401 | | **Duration:** | `00:00:01.1866164`
1402 |
1403 |
1404 | Test Method Details:
1405 |
1406 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1407 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
1408 | * Method Name: `CreateRsaKeyPair`
1409 |
1410 |
1411 |
1412 |
1413 |
1414 |
1415 | -----
1416 |
1417 |
1418 |
1419 |
1420 |
1421 |
1422 |
1423 | :heavy_check_mark: CreateAndExportRsaSansCsr (2048,Sha512)
1424 |
1425 |
1426 | | | |
1427 | |-|-|
1428 | | **ID:** | `b7e7e04d-f63c-415a-8def-848da6b3fe05`
1429 | | **Name:** | `CreateAndExportRsaSansCsr (2048,Sha512)`
1430 | | **Outcome:** | `Passed` :heavy_check_mark:
1431 | | **Computer Name:** | `EZS-001388`
1432 | | **Start:** | `2020-08-04T23:30:03.6535850-04:00`
1433 | | **End:** | `2020-08-04T23:30:16.2482461-04:00`
1434 | | **Duration:** | `00:00:00.8885551`
1435 |
1436 |
1437 | Test Method Details:
1438 |
1439 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1440 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1441 | * Method Name: `CreateAndExportRsaSansCsr`
1442 |
1443 |
1444 |
1445 |
1446 |
1447 |
1448 | -----
1449 |
1450 |
1451 |
1452 |
1453 |
1454 |
1455 |
1456 | :heavy_check_mark: SaveLoadKeyPair (Rsa,2048)
1457 |
1458 |
1459 | | | |
1460 | |-|-|
1461 | | **ID:** | `40f0e9c7-1f60-4f8c-9321-e33bcee32703`
1462 | | **Name:** | `SaveLoadKeyPair (Rsa,2048)`
1463 | | **Outcome:** | `Passed` :heavy_check_mark:
1464 | | **Computer Name:** | `EZS-001388`
1465 | | **Start:** | `2020-08-04T23:31:11.7798043-04:00`
1466 | | **End:** | `2020-08-04T23:31:12.0049819-04:00`
1467 | | **Duration:** | `00:00:00.2148930`
1468 |
1469 |
1470 | Test Method Details:
1471 |
1472 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1473 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
1474 | * Method Name: `SaveLoadKeyPair`
1475 |
1476 |
1477 |
1478 |
1479 |
1480 |
1481 | -----
1482 |
1483 |
1484 |
1485 |
1486 |
1487 |
1488 |
1489 | :heavy_check_mark: SaveLoadCertificate (Ecdsa,256)
1490 |
1491 |
1492 | | | |
1493 | |-|-|
1494 | | **ID:** | `5734871a-6a8b-4f48-ba83-8157d31914e4`
1495 | | **Name:** | `SaveLoadCertificate (Ecdsa,256)`
1496 | | **Outcome:** | `Passed` :heavy_check_mark:
1497 | | **Computer Name:** | `EZS-001388`
1498 | | **Start:** | `2020-08-04T23:30:35.6874402-04:00`
1499 | | **End:** | `2020-08-04T23:30:37.8545586-04:00`
1500 | | **Duration:** | `00:00:00.0086380`
1501 |
1502 |
1503 | Test Method Details:
1504 |
1505 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1506 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
1507 | * Method Name: `SaveLoadCertificate`
1508 |
1509 |
1510 |
1511 |
1512 |
1513 |
1514 | -----
1515 |
1516 |
1517 |
1518 |
1519 |
1520 |
1521 |
1522 | :heavy_check_mark: ExportSelfSignedCert (Ecdsa,256)
1523 |
1524 |
1525 | | | |
1526 | |-|-|
1527 | | **ID:** | `1a3a6e5e-7b71-4ea2-995c-08b1af413dab`
1528 | | **Name:** | `ExportSelfSignedCert (Ecdsa,256)`
1529 | | **Outcome:** | `Passed` :heavy_check_mark:
1530 | | **Computer Name:** | `EZS-001388`
1531 | | **Start:** | `2020-08-04T23:30:26.7481181-04:00`
1532 | | **End:** | `2020-08-04T23:30:27.9431148-04:00`
1533 | | **Duration:** | `00:00:00.3772701`
1534 |
1535 |
1536 | Test Method Details:
1537 |
1538 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1539 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
1540 | * Method Name: `ExportSelfSignedCert`
1541 |
1542 |
1543 |
1544 |
1545 |
1546 |
1547 | -----
1548 |
1549 |
1550 |
1551 |
1552 |
1553 |
1554 |
1555 | :heavy_check_mark: SaveLoadKeyPair (Ecdsa,256)
1556 |
1557 |
1558 | | | |
1559 | |-|-|
1560 | | **ID:** | `74db4a3c-9272-45d8-8026-43fa55f7d8a7`
1561 | | **Name:** | `SaveLoadKeyPair (Ecdsa,256)`
1562 | | **Outcome:** | `Passed` :heavy_check_mark:
1563 | | **Computer Name:** | `EZS-001388`
1564 | | **Start:** | `2020-08-04T23:31:11.7798043-04:00`
1565 | | **End:** | `2020-08-04T23:31:12.0049819-04:00`
1566 | | **Duration:** | `00:00:00.0100120`
1567 |
1568 |
1569 | Test Method Details:
1570 |
1571 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1572 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiKeyTests`
1573 | * Method Name: `SaveLoadKeyPair`
1574 |
1575 |
1576 |
1577 |
1578 |
1579 |
1580 | -----
1581 |
1582 |
1583 |
1584 |
1585 |
1586 |
1587 |
1588 | :heavy_check_mark: ExportSelfSignedPkcs12 (Rsa,2048)
1589 |
1590 |
1591 | | | |
1592 | |-|-|
1593 | | **ID:** | `bbd953a4-363b-4c67-942a-55c5909ddd4d`
1594 | | **Name:** | `ExportSelfSignedPkcs12 (Rsa,2048)`
1595 | | **Outcome:** | `Passed` :heavy_check_mark:
1596 | | **Computer Name:** | `EZS-001388`
1597 | | **Start:** | `2020-08-04T23:30:29.6632242-04:00`
1598 | | **End:** | `2020-08-04T23:30:30.7225185-04:00`
1599 | | **Duration:** | `00:00:00.5794512`
1600 |
1601 |
1602 | Test Method Details:
1603 |
1604 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1605 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateTests`
1606 | * Method Name: `ExportSelfSignedPkcs12`
1607 |
1608 |
1609 |
1610 |
1611 |
1612 |
1613 | -----
1614 |
1615 |
1616 |
1617 |
1618 |
1619 |
1620 |
1621 | :heavy_check_mark: SaveLoadCsr (Rsa,2048)
1622 |
1623 |
1624 | | | |
1625 | |-|-|
1626 | | **ID:** | `3a71ae27-f7af-42f4-a3fc-f7e0a370b270`
1627 | | **Name:** | `SaveLoadCsr (Rsa,2048)`
1628 | | **Outcome:** | `Passed` :heavy_check_mark:
1629 | | **Computer Name:** | `EZS-001388`
1630 | | **Start:** | `2020-08-04T23:30:21.6240102-04:00`
1631 | | **End:** | `2020-08-04T23:30:25.3791356-04:00`
1632 | | **Duration:** | `00:00:03.7253136`
1633 |
1634 |
1635 | Test Method Details:
1636 |
1637 | * Code Base: `C:\local\prj\bek\ACMESharp\ACMESharpCore\test\PKISharp.SimplePKI.UnitTests\bin\Debug\netcoreapp2.1\PKISharp.SimplePKI.UnitTests.dll`
1638 | * Class Name: `PKISharp.SimplePKI.UnitTests.PkiCertificateSigningRequestTests`
1639 | * Method Name: `SaveLoadCsr`
1640 |
1641 |
1642 |
1643 |
1644 |
1645 |
1646 | -----
1647 |
1648 |
1649 |
1650 |
--------------------------------------------------------------------------------
/trx-report/trx2md-alt-sample.xsl:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | # Test Results -
21 |
22 | * Duration: seconds
23 | * Outcome: | Total Tests: | Passed: | Failed:
27 |
28 | ## Tests:
29 |
30 |
31 |
32 |
33 |
34 |
36 |
38 |
39 |
40 | :heavy_check_mark:
41 | :x:
42 | :radio_button:
43 | :grey_question:
44 |
45 |
46 |
47 | <details>
48 | <summary>
49 |
50 |
51 |
52 | </summary>
53 |
54 | | | |
55 | |-|-|
56 | | **Name:** | ``
57 | | **Code Base:** | ``
58 | | **Outcome:** | ``
59 | | **Computer Name:** | ``
60 | | **Duration:** | ``
61 |
62 |
63 |
64 |
65 | <details>
66 | <summary>Error Message:</summary>
67 |
68 | ```text
69 |
70 | ```
71 | </details>
72 |
73 | <details>
74 | <summary>Error Stack Trace:</summary>
75 |
76 | ```text
77 |
78 | ```
79 | </details>
80 |
81 |
82 |
83 | -----
84 |
85 | </details>
86 |
87 |
88 |
89 |
90 |
--------------------------------------------------------------------------------
/trx-report/trx2md.ps1:
--------------------------------------------------------------------------------
1 |
2 | [CmdletBinding()]
3 | param(
4 | [Parameter(Mandatory)]
5 | [string]$trxFile,
6 | [string]$mdFile=$null,
7 | [string]$xslFile=$null,
8 | [hashtable]$xslParams=$null
9 | )
10 |
11 | if ($trxFile -notmatch '^[/\\]') {
12 | $trxFile = [System.IO.Path]::Combine($PWD, $trxFile)
13 | Write-Verbose "Resolving TRX file relative to current directory: $trxFile"
14 | }
15 |
16 | if (-not $mdFile) {
17 | $mdFile = $trxFile
18 | if ([System.IO.Path]::GetExtension($trxFile) -ieq '.trx') {
19 | $mdFile = $trxFile -ireplace '.trx$',''
20 | }
21 | $mdFile += '.md'
22 | Write-Verbose "Resolving default MD file: $mdFile"
23 | }
24 | elseif ($mdFile -notmatch '^[/\\]') {
25 | $mdFile = [System.IO.Path]::Combine($PWD, $mdFile)
26 | Write-Verbose "Resolving MD file relative to current directory: $mdFile"
27 | }
28 |
29 | if (-not $xslFile) {
30 | $xslFile = "$PSScriptRoot/trx2md.xsl"
31 | Write-Verbose "Resolving default XSL file: $xslFile"
32 | }
33 | elseif ($xslFile -notmatch '^[/\\]') {
34 | $xslFile = [System.IO.Path]::Combine($PWD, $xslFile)
35 | Write-Verbose "Resolving XSL file relative to current directory: $xslFile"
36 | }
37 |
38 | class TrxFn {
39 | [double]DiffSeconds([datetime]$from, [datetime]$till) {
40 | return ($till - $from).TotalSeconds
41 | }
42 | }
43 |
44 |
45 | if (-not $script:xslt) {
46 | $script:urlr = [System.Xml.XmlUrlResolver]::new()
47 | $script:opts = [System.Xml.Xsl.XsltSettings]::new()
48 | #$script:opts.EnableScript = $true
49 | $script:xslt = [System.Xml.Xsl.XslCompiledTransform]::new()
50 | try {
51 | $script:xslt.Load($xslFile, $script:opts, $script:urlr)
52 | }
53 | catch {
54 | Write-Error $Error[0]
55 | return
56 | }
57 | Write-Verbose "Loaded XSL transformer"
58 | }
59 |
60 | $script:list = [System.Xml.Xsl.XsltArgumentList]::new()
61 | $script:list.AddExtensionObject("urn:trxfn", [TrxFn]::new())
62 | if ($xslParams) {
63 | foreach ($xp in $xslParams.GetEnumerator()) {
64 | $script:list.AddParam($xp.Key, [string]::Empty, $xp.Value)
65 | }
66 | }
67 | $script:wrtr = [System.IO.StreamWriter]::new($mdFile)
68 | try {
69 | Write-Verbose "Transforming TRX to MD"
70 | $script:xslt.Transform(
71 | [string]$trxFile,
72 | [System.Xml.Xsl.XsltArgumentList]$script:list,
73 | [System.IO.TextWriter]$script:wrtr)
74 | }
75 | finally {
76 | $script:wrtr.Dispose()
77 | }
78 |
--------------------------------------------------------------------------------
/trx-report/trx2md.xsl:
--------------------------------------------------------------------------------
1 |
2 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
25 |
26 |
27 |
28 |
29 | # Test Results -
30 |
31 | Expand the following summaries for more details:
32 |
33 | <details>
34 | <summary> Duration: seconds
35 | </summary>
36 |
37 | | **Times** | |
38 | |--|--|
39 | | **Started:** | `` |
40 | | **Creation:** | ``
41 | | **Queuing:** | ``
42 | | **Finished:** | `` |
43 | | **Duration:** | `` seconds |
44 |
45 | </details>
46 |
47 | <details>
48 | <summary> Outcome: | Total Tests: | Passed: | Failed:
52 | </summary>
53 |
54 | | **Counters** | |
55 | |--|--|
56 | | **Total:** | |
57 | | **Executed:** | |
58 | | **Passed:** | |
59 | | **Failed:** | |
60 | | **Error:** | |
61 | | **Timeout:** | |
62 | | **Aborted:** | |
63 | | **Inconclusive:** | |
64 | | **PassedButRunAborted:** | |
65 | | **NotRunnable:** | |
66 | | **NotExecuted:** | |
67 | | **Disconnected:** | |
68 | | **Warning:** | |
69 | | **Completed:** | |
70 | | **InProgress:** | |
71 | | **Pending:** | |
72 |
73 | </details>
74 |
75 | ## Tests:
76 |
77 |
78 |
79 |
80 |
81 |
83 |
85 |
86 |
87 | :heavy_check_mark:
88 | :x:
89 | :radio_button:
90 | :grey_question:
91 |
92 |
93 |
94 |
114 |
115 | <details>
116 | <summary>
117 |
118 |
119 |
120 | </summary>
121 |
122 | | | |
123 | |-|-|
124 | | **ID:** | ``
125 | | **Name:** | ``
126 | | **Outcome:** | ``
127 | | **Computer Name:** | ``
128 | | **Start:** | ``
129 | | **End:** | ``
130 | | **Duration:** | ``
131 |
132 | <details>
133 | <summary>Test Method Details:</summary>
134 |
135 | * Code Base: ``
136 | * Class Name: ``
137 | * Method Name: ``
138 |
139 | </details>
140 |
141 |
142 |
143 |
144 | <details>
145 | <summary>Error Message:</summary>
146 |
147 | ```text
148 |
149 | ```
150 | </details>
151 |
152 | <details>
153 | <summary>Error Stack Trace:</summary>
154 |
155 | ```text
156 |
157 | ```
158 | </details>
159 |
160 |
169 |
170 |
171 | -----
172 |
173 | </details>
174 |
175 |
176 |
177 |
178 |
--------------------------------------------------------------------------------