- fix: setting any content header (specifically) after setting JSON body resets
HttpContent
to empty by @skwasjer in #99
Full Changelog: v4.3.0...v4.3.1
- feat(net8): add .NET 8 target framework by @skwasjer in #86
- feat(server): implement
IAsyncDisposable
onHttpMockServer
by @skwasjer in #89 - fix(server):
MockHttpServer.StopAsync
disposes the host before it has a chance to actually stop by @skwasjer in #88 - fix(xml): do not modify
XmlSettings
supplied toXmlBody
response builder extension by @skwasjer in #90 - feat: added ctor parameter to
RateLimitedStream
to keep the underlying stream open on disposal by @skwasjer in #95 - feat: added
TransferRate
extension to simulate a slow network transport by @skwasjer in #96
- fix: address some static code analysis issues, exposed by the latest analyzer (in .NET 8 SDK) by @skwasjer in #87
- fix: force GC collect (in unit test) and finalize on appdomain unload by @skwasjer in #91
- chore(deps): bump xunit from 2.6.1 to 2.6.2 by @dependabot in #92
Full Changelog: v4.2.0...v4.3.0
- Address several static code analysis warnings by @skwasjer in #84
- fix(CA2007):
ConfigureAwait(false)
a task - style(CA1819): properties should not return arrays (refactored private/internal use only)
- style(CA1307,CA1309): Use ordinal string comparison overload
- style(CA8602): suppress dereference possible null in test
- style(CA2000): suppress false positive because it is registered for dispose
- style(CA2201): suppress
- style(CA1859): change interface type to concrete type for perf.
- style(CA1054,CA1056): change type of parameter from string to Uri.
- The
MockHttpServer.HostUrl
is deprecated. UseMockHttpServer.HostUri
instead. - The
MockHttpServer
ctors acceptingstring
URL's are deprecated. Use the overloads acceptingSystem.Uri
.
- The
- style(CA1861): prefer 'static readonly' fields over constant array args.
- style(CA1860): prefer comparing count to 0 rather using Any()
- style(CA5394): do not use insecure randomness, suppressed false positive
- fix(CA2007):
- ci: refactored CI, fixing SonarCloud/CodeCov integration, added CodeQL by @skwasjer in #71
- chore(deps): bump FluentAssertions from 6.11.0 to 6.12.0 by @dependabot in #70
- chore(deps): bump NetTestSdkVersion from 17.7.0 to 17.7.1 by @dependabot in #69
- chore(deps): bump NetTestSdkVersion from 17.7.1 to 17.7.2 by @dependabot in #72
- chore(deps): bump Microsoft.AspNet.WebApi.Client from 5.2.9 to 6.0.0 by @dependabot in #74
- chore(deps): bump NetTestSdkVersion from 17.7.2 to 17.8.0 by @dependabot in #77
- chore(deps): bump xunit from 2.4.2 to 2.6.1 by @dependabot in #76
- chore(deps): bump Serilog from 3.0.1 to 3.1.1 by @dependabot in #79
- test(deps): replace Moq with NSubstitute by @skwasjer in #85
- ci: switch fully to GitHub actions instead of AppVeyor by @skwasjer in #83
Full Changelog: v4.1.1...v4.2.0
- fix: data escaped + (plus) was not parsed correctly, caused by #68. My apologies... :)
- fix: data escaped space (+) was not parsing into space char, causing form data matcher to fail to match. by @skwasjer in #68
- chore(deps): replaced Microsoft.AspNet.WebApi.Client with explicit dependencies on Newtonsoft.Json and System.Net.Http to address a security concern regarding transitive dependency on NewtonSoft < 13.x. See GHSA-5crp-9r3c-p9vr.
- fix: .NET Standard 2.0 was not covered. by @skwasjer in #52
- chore(deps): bump NetTestSdkVersion from 17.5.0 to 17.6.0 by @dependabot in #55
- chore(deps): bump FluentAssertions from 6.10.0 to 6.11.0 by @dependabot in #53
- chore(deps): bump NetTestSdkVersion from 17.6.0 to 17.6.2 by @dependabot in #57
- ci: .NET Framework test builds fail with .NET 8 SDK preview by @skwasjer in #65
- ci(deps): bump SonarScanner dependencies by @skwasjer in #66
- chore(deps): bump NetTestSdkVersion from 17.6.2 to 17.7.0 by @dependabot in #64
- Add timeout exception for .NET 5 or greater targets. by @benjaminsampica in #50
- Improve
RateLimitedStream
timing/bit rate calculation accuracy. - Fix guard/exception for the minimum allowed bit rate for
RateLimitedStream
. - Fix underlying stream not being disposed when calling
RateLimitedStream.Dispose()
- Add new Fluent response API by @skwasjer in #10 See also #9 This is a complete replacement of the old response builder API's, and thus likely will require you to refactor your tests (I'm sorry but such is the price of improvement sometimes :( ). See wiki for new API docs/examples. The request matching API's have largely stayed the same, but some extension methods were renamed for consistency.
- Added .NET 7 target framework
- Add stream that rate limits response streams. by @skwasjer in #17
- Additional guards (Argument(Null)Exception) for certain extensions.
- Fix static code analysis warnings.
- Bump Microsoft.AspNet.WebApi.Client from 5.2.7 to 5.2.9 by @dependabot in #23
- Enable nullable by @skwasjer in #27
- Remove obsolete/deprecated code (+semver:major) by @skwasjer in #16
- Removed obsolete
ObjectResponseStrategy
and its extensions. - Removed obsolete
MockHttpHandler.VerifyNoOtherCalls()
. Use the replacementVerifyNoOtherRequests()
- Removed obsolete
UrlMatcher
and its extensions.
- Added
.XmlBody()
response builder extension for LINQ to XML.
- fix: allow zero timespan in
ServerTimeout()
andClientTimeout()
. - fix: do not allow
RateLimitedStream
if the underlying stream is not seekable (except for via stream factory).
- Added new fluent response API which provides more flexibility and control over the response. This new API replaces the current
.Respond()
API, and as such most of the old methods/overloads are now deprecated and will be removed in v4. - Added
RateLimitedStream
helper to simulate network transfer rates. - Renamed
Content
,PartialContent
,JsonContent
request matchers toBody
,PartialBody
,JsonBody
respectively. The old methods are obsolete and will be removed in v4.
- fix: stop evaluating next matchers as soon as a failed match is encountered.
- Added .NET 6.0 and .NET Framework 4.8/4.7.2/4.6.2 target framework support.
- Removed .NET Standard < 2 and .NET Framework 4.5 support.
- Changed to System.Text.Json as default serializer, JSON.NET can be configured as default if desired (
mockHttpHandler.UseNewtonsoftJson()
). - Added .NET 6.0 and .NET Framework 4.8/4.7.2/4.6.2 target framework support.
- Removed .NET Standard < 2 and .NET Framework 4.5 support.
- Added .NET 6 and .NET Core 3.1 target framework support.
- Removed .NET Standard 2.x target frameworks support.
- Added
.Not
matcher (negating any matcher) - Added request header name only matcher (see #3).
- Added .NET 5.0 target framework support.
- Addressed static code analysis suggestions.
- Added MockHttpServer.
- Added .NET Standard 2.1
- fix:
IndexOutOfRangeException
when matching by relative empty request uri
- Renamed a
Headers()
overload intoHeader()
since it only matches 1 header. - fix: throw ANE's from extensions to avoid potential NRE's.
- fix: SourceLink not working to due invalid (non-portable) symbols
- fix: matching on JSON arrays and simple values was throwing exception (ie.:
matching.JsonContent("match this")
).
- fix: Clearing invoked requests did not reset response sequence setups.
- Added support to chain responses, f.ex.:
.Throws(...).Respond(...).Respond(...)
. - Added
TimesOut()
andTimesOutAfter(millisecs)
response extensions. - Renamed
VerifyNoOtherCalls()
toVerifyNoOtherRequests()
, and fixed the verification not taking into account requests toVerify(m => ....)
. - Fix race condition when resetting mock, while an asynchronous request or expectation verification is in progress.
- Moved JSON extensions to
skwas.MockHttp.Json
package as to not require dependencies on Json.NET if one does not need JSON support. - Added
VerifyAsync(Action<RequestMatching> matching, IsSent times, string because = null)
to avoid deadlocking when verifyingHttpContent
. - Added
.FormData(...)
matcher.
.Url()
is replaced with.RequestUri()
, but left in for compatibility (will be removed).- added matcher to match request by HTTP message version.
- (breaking) replaced
IHttpRequestMatcher
with abstract classHttpRequestMatcher
. This breaks the public API, but acceptable since no big audience ;) - added more overloads for configuring responses.
- Fix: query string constraint for only a key
?key
(no = sign or value) is now accepted and will be matched asnull
, ie.: (.QueryString("key", null)
). - Fix: multiple partial match constraints can now be used.
- Fix: some matchers are mutually exclusive. An exception will be thrown if this is the case.
- Remove glob URI matcher for now, as this requires an extra dependency. Rethink this for future.
- Remove
TypeConverter
package dependency.
- Some refactoring of Fluent API.
- Add response extensions for HttpContent, Stream and others.
- Initial