@@ -100,7 +100,7 @@ Run the following commands from the command line to get your local environmentse
100
100
``` bash
101
101
$ git clone https://github.com/firebase/firebase-admin-dotnet.git
102
102
$ cd firebase-admin-dotnet/FirebaseAdmin # Change into the FirebaseAdmin solution directory
103
- $ dotnet restore # Install dependencies
103
+ $ dotnet restore # Install dependencies
104
104
```
105
105
106
106
### Running Tests
@@ -119,6 +119,24 @@ To run the unit test suite:
119
119
$ dotnet test FirebaseAdmin.Tests
120
120
```
121
121
122
+ To invoke code coverage tools, run the unit tests as follows:
123
+
124
+ ``` bash
125
+ $ dotnet test FirebaseAdmin.Tests /p:CollectCoverage=true
126
+ ```
127
+
128
+ The above command calculates and displays a code coverage summary. To produce a more detailed
129
+ code coverage report, you can use a tool like
130
+ [ Report Generator] ( https://github.com/danielpalme/ReportGenerator ) :
131
+
132
+ ``` bash
133
+ $ dotnet test FirebaseAdmin.Tests /p:CollectCoverage=true /p:CoverletOutputFormat=opencover
134
+ $ dotnet path/to/ReportGenerator.dll -reports:./FirebaseAdmin.Tests/coverage.opencover.xml -targetdir:./reports
135
+ ```
136
+
137
+ This generates a collection of HTML code coverage reports in a local subdirectory named
138
+ ` reports/ ` .
139
+
122
140
The integration test suite requires a service account JSON key file, and an API key for a Firebase
123
141
project. Create a new project in the [ Firebase console] ( https://console.firebase.google.com ) if
124
142
you do not already have one. Use a separate, dedicated project for integration tests since the
@@ -143,4 +161,3 @@ Here are some highlights of the directory structure and notable source files
143
161
* ` FirebaseAdmin.Tests/ ` - Unit tests directory.
144
162
* ` FirebaseAdmin.IntegrationTests/ ` - Integration tests directory.
145
163
* ` FirebaseAdmin.Snippets/ ` - Example code snippets for the SDK.
146
-
0 commit comments