Skip to content

Commit 8097751

Browse files
authored
Added project documentation
- Updated README.md - Renamed LICENSE to LICENSE.md - Added CONTRIBUTING.md - Added GitHub issue and PR templates.
1 parent 25b9964 commit 8097751

File tree

9 files changed

+149
-4
lines changed

9 files changed

+149
-4
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ indent_style = space
66
indent_size = 4
77
trim_trailing_whitespace = true
88

9+
[*.md]
10+
trim_trailing_whitespace = false
11+
912
[*.csproj]
1013
indent_size = 2
1114

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Code example that reproduces the behavior:
15+
```
16+
[Fact]
17+
public void Issue()
18+
{
19+
...
20+
}
21+
```
22+
23+
**Expected behavior**
24+
A clear and concise description of what you expected to happen.
25+
26+
**Background (please complete the following information):**
27+
- OS: [e.g. iOS]
28+
- Version of library: [e.g. 22]
29+
- Version of dotnet core: [e.g. 3.1]
30+
31+
**Additional context**
32+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
name: Question
3+
about: Ask a question
4+
title: ''
5+
labels: question
6+
assignees: ''
7+
8+
---
9+

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fixes # .
2+
3+
** Reminder **
4+
- Did you add unit tests?
5+
- Did you consider adding an integration test for documentation?
6+
- Did you follow the coding guidelines and run dotnet format?

CONTRIBUTING.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# How to contribute
2+
Thank you for your willingness to help with this project. Although we are happy with all the help, we do want to set some guidelines on how to contribute to this project. By following these guidelines you can help us to manage our time and spend more time on developing this open source project.
3+
4+
## Do you have a question?
5+
- Questions can be asked via GitHub issue, using the tag "Question"
6+
- Please ensure the question is not already asked, by searching all issues with the "Question" tag.
7+
- Please close the issue yourself when the question is answered.
8+
9+
## Did you find a bug?
10+
- Please make sure the bug is not already reported.
11+
- Please open a GitHub issue.
12+
- Add a clear title and description.
13+
- If possible include a simple unit test describing the bug. A few lines of code will say a lot more than a few paragraphs of text.
14+
- If you need the fix urgently, please consider creating a Pull Request with the fix.
15+
16+
## Did you write a patch to fix a bug?
17+
- Please open a Pull Request with the patch.
18+
- Link the issue to the Pull Request.
19+
- Ensure the description clearly describes the problem and solution.
20+
- Make sure there is a test that proves that the issue did exists and is now fixed.
21+
22+
## Did you write a patch to fix code style issues?
23+
Please do **not** submit a Pull Request.
24+
25+
## Did you want to refactor code to make it more readable and better maintainable?
26+
- Please open a GitHub issue to discuss it.
27+
- Clearly describe what you want to refactor and why.
28+
- Did you forget to open an issue? Please describe the reasoning in the Pull Request itself. But be advised that this could mean that you spend time refactoring and we still reject the Pull Request.
29+
30+
## Do you have great ideas for the project?
31+
- Please open a GitHub issue to discuss it.
32+
- Do **not** open a Pull Request before discussing it.
File renamed without changes.

README.md

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,47 @@
11
# httpclienttesthelpers
2-
Using HttpClient in code that is unittested is seen as rather difficult, this library aims to make it easier to assert the calls that are made via an HttpClient.
32

4-
This library is largly based on the HttpTest functionality from [Flurl](https://flurl.dev), but is focused around the use of HttpClient directly. Since I intend to replace my usage of Flurl.Http with this library, I kept the interface very similar.
3+
Using HttpClient in code that is unit tested is seen as rather difficult, this library aims to make it easier to assert the calls that are made via an HttpClient.
4+
5+
## How to install
6+
7+
This library is released as a NuGet package and can be installed via the NuGet manager in Visual Studio or by running the following command:
8+
9+
```
10+
dotnet add package HttpClientTestHelpers
11+
```
12+
13+
## How to use
14+
15+
```c#
16+
var testHandler = new TestableHttpMessageHandler();
17+
var httpClient = new HttpClient(testHandler);
18+
19+
var result = await httpClient.GetAsync("http://httpbin.org/status/200");
20+
21+
testHandler.ShouldHaveMadeRequestsTo("https://httpbin.org/*");
22+
```
23+
24+
More examples can be found in the [IntegrationTests project](https://github.com/dnperfors/httpclienttesthelpers/tree/master/test/HttpClientTestHelpers.IntegrationTests)
25+
26+
## Contributing
27+
28+
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how you can help us out.
29+
30+
## Versioning
31+
32+
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [releases on this repository](https://github.com/dnperfors/httpclienttesthelpers/releases).
33+
34+
## Authors
35+
36+
* **David Perfors** - [dnperfors](https://github.com/dnperfors)
37+
38+
See also the list of [contributors](https://github.com/dnperfors/httpclienttesthelpers/contributors) who participated in this project.
39+
40+
## License
41+
42+
This project is released under the MIT license, see [LICENSE.md](LICENSE.md) for more information.
43+
44+
## Acknowledgments
45+
46+
This library is largely inspired by the HttpTest functionality from [Flurl](https://flurl.dev).
47+
A lot of the ideas came from the thread about unit testing HttpClient code in [this dotnet issue](https://github.com/dotnet/runtime/issues/14535).

src/HttpClientTestHelpers/HttpClientTestHelpers.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<Description>A simple library to make testing HttpClient and related classes easier.</Description>
1515
<PackageProjectUrl>https://github.com/dnperfors/httpclienttesthelpers</PackageProjectUrl>
1616
<RepositoryUrl>https://github.com/dnperfors/httpclienttesthelpers</RepositoryUrl>
17-
<PackageLicenseFile>LICENSE</PackageLicenseFile>
17+
<PackageLicenseFile>LICENSE.md</PackageLicenseFile>
1818
</PropertyGroup>
1919

2020
<ItemGroup>
@@ -26,7 +26,7 @@
2626
</ItemGroup>
2727

2828
<ItemGroup>
29-
<None Include="..\..\LICENSE">
29+
<None Include="..\..\LICENSE.md">
3030
<Pack>True</Pack>
3131
<PackagePath></PackagePath>
3232
</None>

0 commit comments

Comments
 (0)