|
| 1 | +# Changelog |
| 2 | +All notable changes to TestableHttpClient will be documented in this file. |
| 3 | + |
| 4 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and |
| 5 | +this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 6 | + |
| 7 | +## [Unreleased] |
| 8 | + |
| 9 | +## [0.4] - 2020-05-26 |
| 10 | +### Removed |
| 11 | +- the following deprecated api's are removed: |
| 12 | + - `HttpResponseMessageBuilder.WithVersion(Version)` |
| 13 | + - `HttpResponseMessageBuilder.WithStatusCode(HttpStatusCode)` |
| 14 | + - `HttpResponseMessageBuilder.WithHeaders(Actions<HttpResponseHeaders>)` |
| 15 | + - `HttpResponseMessageBuilder.WithHeader(string, string)` |
| 16 | + - `HttpResponseMessageExtensions.HasHttpVersion(HttpResponseMessage, string)` |
| 17 | + |
| 18 | +### Added |
| 19 | +- `TestableHttpMessageHandlerExtensions.CreateClient(TestableHttpMessageHandler)` |
| 20 | +- `TestableHttpMessageHandlerExtensions.CreateClient(TestableHttpMessageHandler, Action<HttpClient>)` |
| 21 | + |
| 22 | +### Changed |
| 23 | +- Example on how to configure IHttpClientFactory now uses dependency injection, just how you would use it in real life. |
| 24 | + |
| 25 | +## [0.3] - 2020-05-24 |
| 26 | +### Added |
| 27 | +- Examples on how to use TestableHttpClient in combination with IHttpClientFactory. Note that this is revised in the next release. |
| 28 | +- `HttpRequestMessageExtensions.HasContent(HttpRequestMessage)` |
| 29 | +- `HttpResponseMessageExtensions.HasContent(HttpResponseMessage)` |
| 30 | + |
| 31 | +### Changed |
| 32 | +- Improve error messages in NFluent checks |
| 33 | +- Improve release pipeline |
| 34 | +- Renamed several api's: |
| 35 | + - `HttpResponseMessageBuilder.WithVersion(Version)` is renamed to `WithHttpVersion(Version)` |
| 36 | + - `HttpResponseMessageBuilder.WithStatusCode(HttpStatusCode)` is renamed to `WithHttpStatusCode(HttpStatusCode)` |
| 37 | + - `HttpResponseMessageBuilder.WithHeaders(Actions<HttpResponseHeaders>)` is renamed to `WithResponseHeaders(Actions<HttpResponseHeaders>)` |
| 38 | + - `HttpResponseMessageBuilder.WithHeader(string, string)` is renamed to `WithResponseHeader(string, string)` |
| 39 | + |
| 40 | +### Deprecated |
| 41 | +- the following api's are deprecated because they are renamed: |
| 42 | + - `HttpResponseMessageBuilder.WithVersion(Version)` |
| 43 | + - `HttpResponseMessageBuilder.WithStatusCode(HttpStatusCode)` |
| 44 | + - `HttpResponseMessageBuilder.WithHeaders(Actions<HttpResponseHeaders>)` |
| 45 | + - `HttpResponseMessageBuilder.WithHeader(string, string)` |
| 46 | +- the following api is deprecated because it is inconsistent: |
| 47 | + - `HttpResponseMessageExtensions.HasHttpVersion(HttpResponseMessage, string)` |
| 48 | + |
| 49 | +## [0.2] - 2020-05-10 |
| 50 | +### Added |
| 51 | +- TestableHttpClient.NFluent project. This project provides NFluent checks to check HttpResponseMessages. The following checks can be used: |
| 52 | + - `HasHttpStatusCode(ICheck<HttpResponseMessage>, HttpStatusCode)` |
| 53 | + - `HasReasonPhrase(ICheck<HttpResponseMessage>, string)` |
| 54 | + - `HasHttpVersion(ICheck<HttpResponseMessage>, Version)` |
| 55 | + - `HasResponseHeader(ICheck<HttpResponseMessage>, string)` |
| 56 | + - `HasResponseHeader(ICheck<HttpResponseMessage>, string, string)` |
| 57 | + - `HasContentHeader(ICheck<HttpResponseMessage>, string)` |
| 58 | + - `HasContentHeader(ICheck<HttpResponseMessage>, string, string)` |
| 59 | + - `HasContent(ICheck<HttpResponseMessage>)` |
| 60 | + - `HasContent(ICheck<HttpResponseMessage>, string)` |
| 61 | +- `HttpResponseMessageExtensions` to easily check information on `HttpResponseMessages` |
| 62 | + - `HasHttpVersion(HttpResponseMessage, Version)` |
| 63 | + - `HasHttpVersion(HttpResponseMessage, string)` |
| 64 | + - `HasHttpStatusCode(HttpResponseMessage, HttpStatusCode)` |
| 65 | + - `HasReasonPhrase(HttpResponseMessage, string)` |
| 66 | + - `HasResponseHeader(HttpResponseMessage, string)` |
| 67 | + - `HasResponseHeader(HttpResponseMessage, string, string)` |
| 68 | + - `HasContentHeader(HttpResponseMessage, string)` |
| 69 | + - `HasContentHeader(HttpResponseMessage, string, string)` |
| 70 | + - `HasContent(HttpResponseMessage, string)` |
| 71 | + |
| 72 | +## [0.1] - 2020-03-26 |
| 73 | +### Added |
| 74 | +- `TestableHttMessageHandler` to record all requests that are made with an `HttpClient` |
| 75 | + - `RespondWith(HttpResponseMessage)` |
| 76 | + - `RespondWith(Action<HttpResponseMessageBuilder>)` |
| 77 | + - `SimulateTimeout()` |
| 78 | + - `ShouldHaveMadeRequests()` |
| 79 | + - `ShouldHaveMadeRequestsTo(string)` |
| 80 | + - `ShouldNotHaveMadeRequests()` |
| 81 | + - `ShouldNotHaveMadeRequestsTo(string)` |
| 82 | +- `HttpResponseMessageBuilder` for creating HttpResponseMessages in a fluent way |
| 83 | + - `WithVersion(Version)` |
| 84 | + - `WithStatusCode(HttpStatusCode)` |
| 85 | + - `WithHeaders(Action<HttpResponseHeaders>)` |
| 86 | + - `WithHeader(string, string)` |
| 87 | + - `WithContent(HttpContent)` |
| 88 | + - `WithStringContent(string)` |
| 89 | + - `WithStringContent(string, Encoding)` |
| 90 | + - `WithStringContent(string, Encoding, string)` |
| 91 | + - `WithJsonContent(object)` |
| 92 | + - `WithJsonContent(object, string)` |
| 93 | + - `WithRequestMessage(HttpRequestMessage)` |
| 94 | + - `Build()` |
| 95 | +- `HttpRequestMessageAsserter` to validate that certain requests are made. This can be requested by calling `TestableHttpMessageHandler.ShouldHaveMadeRequests()` or `TestableHttpMessageHandler.ShouldHaveMadeRequestsTo(string)`. The following methods are available: |
| 96 | + - `With(Func<HttpRequestMessage, bool>, string)` |
| 97 | + - `WithUriPattern(string)` |
| 98 | + - `WithHttpMethod(HttpMethod)` |
| 99 | + - `WithHttpVersion(Version)` |
| 100 | + - `WithRequestHeader(string)` |
| 101 | + - `WithRequestHeader(string, string)` |
| 102 | + - `WithContentHeader(string)` |
| 103 | + - `WithContentHeader(string, string)` |
| 104 | + - `WithHeader(string)` |
| 105 | + - `WithHeader(string, string)` |
| 106 | + - `WithContent(string)` |
| 107 | + - `WithJsonContent(object)` |
| 108 | + - `WithFormUrlEncodedContent(IEnumerable<KeyValuePair<string, string>>)` |
| 109 | + - `Times(int)` |
| 110 | +- `HttpRequestMessageExtensions` with extension methods for testing a data on HttpRequestMessages |
| 111 | + - `HasHttpVersion(HttpRequestMessage, Version)` |
| 112 | + - `HasHttpVersion(HttpRequestMessage, string)` |
| 113 | + - `HasHttpMethod(HttpRequestMessage, HttpMethod)` |
| 114 | + - `HasHttpMethod(HttpRequestMessage, string)` |
| 115 | + - `HasRequestMessage(HttpRequestMessage, string)` |
| 116 | + - `HasRequestMessage(HttpRequestMessage, string, string)` |
| 117 | + - `HasContentMessage(HttpRequestMessage, string)` |
| 118 | + - `HasContentMessage(HttpRequestMessage, string, string)` |
| 119 | + - `HasMatchingUri(HttpRequestMessage, string)` |
| 120 | + - `HasContent(HttpRequestMessage, string)` |
| 121 | +- Created an integrationtest project that showcases all the basic features |
| 122 | +- Created readme file |
| 123 | +- Automatically build project when pushing changes to github and when creating a pull request |
| 124 | +- Automatically deploy to NuGet when creating a tag in github |
| 125 | + |
| 126 | +[Unreleased]: https://github.com/dnperfors/TestableHttpClient/compare/v0.4...HEAD |
| 127 | +[0.4]: https://github.com/dnperfors/TestableHttpClient/compare/v0.3...v0.4 |
| 128 | +[0.3]: https://github.com/dnperfors/TestableHttpClient/compare/v0.2...v0.3 |
| 129 | +[0.2]: https://github.com/dnperfors/TestableHttpClient/compare/v0.1...v0.2 |
| 130 | +[0.1]: https://github.com/dnperfors/TestableHttpClient/releases/tag/v0.1 |
0 commit comments