Skip to content

Releases: skwasjer/MockHttp

v4.5.0

02 Oct 01:18
cbd8190
Compare
Choose a tag to compare

What's Changed

  • chore: replace TaskHelpers with a more robust impl. by @skwasjer in #114
  • feat: add StringSyntaxAttribute to RequestUri extension by @skwasjer in #116
  • feat: remove .NET Core 3.1 from skwas.MockHttp.Server (EOL) by @skwasjer in #122

Chores / others

Full Changelog: v4.4.0...v4.5.0

v4.4.0

10 Sep 02:46
5753c8d
Compare
Choose a tag to compare

What's Changed

  • fix: The package skwas.MockHttp.Server.4.3.0 is missing a readme. by @skwasjer in #101
  • fix(CA1307): 'string.Replace(string, string)' has a method overload that takes a 'StringComparison' parameter. by @skwasjer in #102
  • fix(xUnit1012): Null should not be used for value type parameters by @skwasjer in #103
  • perf(CA1848): Use the LoggerMessage delegates by @skwasjer in #104
  • fix(CA1031): use exception handler middleware instead of catching all exceptions in ServerRequestHandler by @skwasjer in #105
  • fix: wildcard match does not escape special regex characters by @skwasjer in #106
  • chore: remove .NET 7 since this is now EOL by @skwasjer in #108
  • refactor: replaced RequestUriMatcher with UriMatcher by @skwasjer in #110
  • refactor: add new Pattern type that replaces IPatternMatcher<> to simplify API. by @skwasjer in #111
  • fix: restore public API compatibility. by @skwasjer in #113

Chores

  • ci: change to v4 actions / upgrade to NodeJS 20 by @skwasjer in #100
  • ci: macos-latest has updated to ARM-based MacOS 14 which causes pipeline fail by @skwasjer in #107
  • chore(deps): bump test dependencies by @skwasjer in #109

Full Changelog: v4.3.1...v4.4.0

v4.3.1

31 Jan 12:09
5fc8d3b
Compare
Choose a tag to compare

What's Changed

  • 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

v4.3.0

24 Dec 13:42
48dd275
Compare
Choose a tag to compare

What's Changed

  • feat(net8): add .NET 8 target framework by @skwasjer in #86
  • feat(server): implement IAsyncDisposable on HttpMockServer 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 to XmlBody 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

Chores

  • 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

v4.2.0

18 Nov 09:55
e86fc17
Compare
Choose a tag to compare

What's Changed

  • 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. Use MockHttpServer.HostUri instead.
      • The MockHttpServer ctors accepting string URL's are deprecated. Use the overloads accepting System.Uri.
    • 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

Chores

  • 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

v4.1.1

13 Aug 01:13
Compare
Choose a tag to compare

What's Changed

  • fix: data escaped + (plus) was not unescaped correctly.

Full Changelog: v4.1.0...v4.1.1

v4.1.0

12 Aug 15:00
Compare
Choose a tag to compare

What's Changed

  • fix: data escaped space (+) was not parsing into space char. 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.

Chores

  • 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

Full Changelog: v4.0.1...v4.1.0

v4.0.1

25 Mar 01:11
Compare
Choose a tag to compare

What's Changed

  • 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()

New Contributors

Full Changelog: v4.0.0...v4.0.1

v4.0.0

03 Jan 00:17
Compare
Choose a tag to compare

What's Changed

  • 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. E.g.:
    MockHttpHandler mockHttp = new MockHttpHandler();
    
    // Configure setup(s).
    mockHttp
        .When(matching => matching
            .Method("GET")
            .RequestUri("http://localhost/controller/*")
            .QueryString("id", 123)
        )
        .Respond(with => with
            .StatusCode(200)
            .JsonBody(new { id = 123, firstName = "John", lastName = "Doe" })
        )
        .Verifiable();
    The new response API also comes with some new features/improvements:
    • .ClientTimeout(100.Milliseconds())
    • .ServerTimeout(100.Milliseconds())
    • .Latency(NetworkLatency.FiveG)
  • Added .NET 7 target framework
  • Add stream that rate limits response streams. by @skwasjer in #17 E.g.:
    using Stream stream = File.OpenRead(...); // A big stream
    
    mockHttpHandler
        .When(matching => ...)
        .Respond(with => with.Body(() => new RateLimitedStream(stream, 512000))); // Rate limited to 512 kbps
  • 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 by @skwasjer in #16

Full Changelog: v3.0.1...v4.0.0

The changes above were previously pre-released as v3.1.0-rcXXX but there are numerous (breaking) changes that warrant a major release.

v4.0.0-pre1

02 Jan 23:59
Compare
Choose a tag to compare
v4.0.0-pre1 Pre-release
Pre-release

What's Changed

  • 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

Full Changelog: v3.0.1...v4.0.0

The changes above were previously pre-released as v3.1.0-rcXXX but there are numerous (breaking) changes that warrant a major release.