File tree Expand file tree Collapse file tree 5 files changed +25
-8
lines changed
algorithm-exercises-csharp Expand file tree Collapse file tree 5 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -135,3 +135,8 @@ _NCrunch*
135
135
# VSCode C# Dev Kit
136
136
137
137
.mono
138
+
139
+ # Coverage
140
+ coverage.cobertura.xml
141
+ coverage.json
142
+ lcov.info
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ build: env dependencies
79
79
${PACKAGE_TOOL} build --verbosity ${VERBOSITY_LEVEL}
80
80
81
81
test : build
82
- ${PACKAGE_TOOL} test --verbosity ${VERBOSITY_LEVEL}
82
+ ${PACKAGE_TOOL} test --verbosity ${VERBOSITY_LEVEL} /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=lcov.info
83
83
84
84
coverage : dependencies
85
85
Original file line number Diff line number Diff line change 16
16
17
17
<ItemGroup >
18
18
<PackageReference Include =" coverlet.collector" Version =" 6.0.0" />
19
+ <PackageReference Include =" coverlet.msbuild" Version =" 6.0.2" >
20
+ <IncludeAssets >runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets >
21
+ <PrivateAssets >all</PrivateAssets >
22
+ </PackageReference >
19
23
<PackageReference Include =" Microsoft.NET.Test.Sdk" Version =" 17.8.0" />
20
24
<PackageReference Include =" MSTest.TestAdapter" Version =" 3.1.1" />
21
25
<PackageReference Include =" MSTest.TestFramework" Version =" 3.1.1" />
Original file line number Diff line number Diff line change
1
+ namespace algorithm_exercises_csharp ;
2
+
3
+ public class HelloWorld
4
+ {
5
+ protected HelloWorld ( ) { }
6
+
7
+ public static string Hello ( )
8
+ {
9
+ return "Hello World!" ;
10
+ }
11
+ }
Original file line number Diff line number Diff line change @@ -6,13 +6,10 @@ public class UnitTest1
6
6
[ TestMethod ]
7
7
public void TestMethod1 ( )
8
8
{
9
- }
10
- }
9
+ string expected = "Hello World!" ;
10
+ string result = HelloWorld . Hello ( ) ;
11
11
12
- public class unittest2
13
- {
14
- [ TestMethod ]
15
- public void TestMethod1 ( )
16
- {
12
+ Assert . AreEqual ( expected , result ) ;
17
13
}
18
14
}
15
+
You can’t perform that action at this time.
0 commit comments