Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
80px
80px.com
dotnet
HelloWorld
Commits
0f0e726d
Verified
Commit
0f0e726d
authored
Jul 25, 2021
by
Mark Malone
Browse files
readme cleanups, coverage regex fix, dotnet tool config added
parent
372dd23c
Changes
6
Hide whitespace changes
Inline
Side-by-side
.config/dotnet-tools.json
0 → 100644
View file @
0f0e726d
{
"version"
:
1
,
"isRoot"
:
true
,
"tools"
:
{
"dotnet-reportgenerator-globaltool"
:
{
"version"
:
"4.8.12"
,
"commands"
:
[
"reportgenerator"
]
}
}
}
\ No newline at end of file
.gitignore
View file @
0f0e726d
...
...
@@ -16,6 +16,9 @@
# Mono auto generated files
mono_crash.*
# Coverage report
Reports_Coverage/
# Build results
[Dd]ebug/
[Dd]ebugPublic/
...
...
@@ -60,8 +63,8 @@ BenchmarkDotNet.Artifacts/
project.lock.json
project.fragment.lock.json
artifacts/
# Tye
# Tye
.tye/
# StyleCop
...
...
@@ -304,8 +307,8 @@ paket-files/
# FAKE - F# Make
.fake/
# Ionide - VsCode extension for F# Support
# Ionide - VsCode extension for F# Support
.ionide/
# CodeRush personal settings
...
...
.gitlab-ci.yml
View file @
0f0e726d
...
...
@@ -2,7 +2,7 @@ image: microsoft/dotnet:latest
before_script
:
-
'
echo
|
dotnet
--version'
-
dotnet tool
install dotnet-reportgenerator-globaltool --tool-path tools
-
dotnet tool
restore
stages
:
-
test
...
...
@@ -13,10 +13,8 @@ build:
-
dotnet test --collect:"XPlat Code Coverage"
-
ls -ld */TestResults/*
-
ls -ld ${CI_PROJECT_DIR}/*/TestResults/*/*
# each reporttype must be a separate line, doesn't work together ; separated
-
./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:TextSummary;
-
./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:Html;
-
dotnet reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:TextSummary;
-
ls Reports_Coverage
-
cat ./Reports_Coverage/Summary.txt
-
echo 'End Summary'
coverage
:
/
Summary\n[\s\S]*
/
coverage
:
/
Line coverage
:
*
\s+([\d\.]+)%
/
HelloWorld.Tests/
Unit
Test
1
.cs
→
HelloWorld.Tests/
HelloWorld
Test
s
.cs
View file @
0f0e726d
...
...
@@ -4,13 +4,12 @@ using HelloWorld;
namespace
HelloWorld.Tests
{
public
class
Unit
Test
1
public
class
HelloWorld
Test
s
{
[
Fact
]
public
void
Test1
()
{
Console
.
WriteLine
(
HelloWorld
.
Program
.
HelloWorld
());
Assert
.
Equal
(
HelloWorld
.
Program
.
HelloWorld
(),
"Hello World!"
);
Assert
.
Equal
(
"Hello World!"
,
HelloWorld
.
Program
.
HelloWorld
());
}
}
}
README.md
View file @
0f0e726d
...
...
@@ -5,33 +5,11 @@ HelloWorld is a dotnet 5.0 project to return "Hello world".
## Installation
Use
the package manager
[
dotnet
](
https://dotnet.microsoft.com/
)
to
install
HelloWorld.
Use
[
dotnet
](
https://dotnet.microsoft.com/
)
to
build and run
HelloWorld.
## Usage
### Building the program
```
bash
dotnet build
```
```
bash
Microsoft
(
R
)
Build Engine version 16.9.0+5e4b48a27
for
.NET
Copyright
(
C
)
Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date
for
restore.
HelloWorld -> .../helloworld/HelloWorld/bin/Debug/net5.0/HelloWorld.dll
HelloWorld.Tests -> .../helloworld/HelloWorld.Tests/bin/Debug/net5.0/HelloWorld.Tests.dll
Build succeeded.
0 Warning
(
s
)
0 Error
(
s
)
Time Elapsed 00:00:02.25
```
### Running the program
...
...
@@ -62,6 +40,30 @@ Hello World!
Passed! - Failed: 0, Passed: 1, Skipped: 0, Total: 1, Duration: 11 ms - .../helloworld/HelloWorld.Tests/bin/Debug/net5.0/HelloWorld.Tests.dll
(
net5.0
)
```
### Building the program
```
bash
dotnet build
```
```
bash
Microsoft
(
R
)
Build Engine version 16.9.0+5e4b48a27
for
.NET
Copyright
(
C
)
Microsoft Corporation. All rights reserved.
Determining projects to restore...
All projects are up-to-date
for
restore.
HelloWorld -> .../helloworld/HelloWorld/bin/Debug/net5.0/HelloWorld.dll
HelloWorld.Tests -> .../helloworld/HelloWorld.Tests/bin/Debug/net5.0/HelloWorld.Tests.dll
Build succeeded.
0 Warning
(
s
)
0 Error
(
s
)
Time Elapsed 00:00:02.25
```
## Contributing
See
[
CONTRIBUTING.md
](
https://code.80px.com/80px/80px.com/dotnet/helloworld/-/blob/master/CONTRIBUTING.md
)
...
...
gitlab-ci.yaml
deleted
100644 → 0
View file @
372dd23c
image
:
mcr.microsoft.com/dotnet/sdk:5.0
before_script
:
-
'
echo
|
dotnet
--version'
-
dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools
stages
:
-
test
build
:
stage
:
test
script
:
-
dotnet test --collect:"XPlat Code Coverage"
-
ls -ld */TestResults/*
-
ls -ld ${CI_PROJECT_DIR}/*/TestResults/*/*
# each reporttype must be a separate line, doesn't work together ; separated
-
./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:TextSummary;
-
./tools/reportgenerator "-reports:${CI_PROJECT_DIR}/*/TestResults/*/coverage.cobertura.xml" "-targetdir:Reports_Coverage" -reportTypes:Html;
-
ls Reports_Coverage
-
cat ./Reports_Coverage/Summary.txt
-
echo 'End Summary'
coverage
:
/Summary\n[\s\S]*/
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment