AddUp.FakeRabbitMQ 2.8.0

dotnet add package AddUp.FakeRabbitMQ --version 2.8.0
NuGet\Install-Package AddUp.FakeRabbitMQ -Version 2.8.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AddUp.FakeRabbitMQ" Version="2.8.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AddUp.FakeRabbitMQ --version 2.8.0
#r "nuget: AddUp.FakeRabbitMQ, 2.8.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install AddUp.FakeRabbitMQ as a Cake Addin
#addin nuget:?package=AddUp.FakeRabbitMQ&version=2.8.0

// Install AddUp.FakeRabbitMQ as a Cake Tool
#tool nuget:?package=AddUp.FakeRabbitMQ&version=2.8.0

AddUp.FakeRabbitMQ

Build Quality Gate Status Coverage NuGet

Important Notice

On 2020/10/04, and starting with version 1.2.3, AddUp.RabbitMQ.Fakes was renamed to AddUp.FakeRabbitMQ. This concerns:

However, the root namespace remains (for compatibility purpose) AddUp.RabbitMQ.Fakes.

I deemed this renaming necessary as the Fakes suffix collides with Microsoft Fakes product. Because the assembly name ends with .Fakes, several unit-test related tools consider it not to be a real assembly but rather something generated by Microsoft Fakes.

About

AddUp.FakeRabbitMQ is a fork of https://github.com/Parametric/RabbitMQ.Fakes. Thanks to the folks over there for their work without which our own version would probably never have been possible.

AddUp.FakeRabbitMQ provides fake implementations of the RabbitMQ.Client interfaces (see https://www.nuget.org/packages/RabbitMQ.Client for the nuget package and https://github.com/rabbitmq/rabbitmq-dotnet-client for its source code). They are intended to be used for testing so that unit tests that depend on RabbitMQ can be executed fully in memory withouth needing an external RabbitMQ server.

AddUp.FakeRabbitMQ builds on top of the original project:

  • Targets .NET Standard 2.0
  • Supports Default, Direct, Topic and Fanout exchange types.
    • NB: Headers exchange type is not supported; however, it won't throw (it is implemented the same way as the Fanout type)

Hall of fame

Thanks to all the contributors:

History

Versions 1.x are based on RabbitMQ .NET client Version 5.x

Versions 2.x are based on RabbitMQ .NET client Version 6.x

Version 2.8.0 - 2023/11/13

  • Fixed Issue #180: Now non-AutoAck scenarios work better (not sure though if they are completely equivalent to what a real RabbitMQ instance would do). Thanks to @manuelspezzani for providing repro unit tests.

Note that this version might be technically breaking as some public members are now either internal or implemented rather differently. Anyway those are implementation details and should not be used from client code. I intend to internalize more implementation details in the future so as to not leak abstractions.

Also note that this is far from being bulletproof: The unit tests associated with issue #180 pass, but there are still many scenarios that do not work the same as with a real RabbitMQ server (for example, do not try to requeue a nacked message, it won't work).

Version 2.7.0 - 2023/10/16

Version 2.6.0 - 2023/03/29

  • Updated RabbitMQ.Client to version 6.5.0

Version 2.5.0 - 2022/12/14

Two contributions by @patrikwlund:

  • Better compliance: No more unique singleton-based connection. See PR #122 for details.
  • New feature: by passing a boolean to the constructor of AddUp.RabbitMQ.Fakes.RabbitServer, one can opt into using blocking delivery (the default remains non-blocking). This helps simplifying unit tests in scenarios where one is not interested in simulating a real RabbitMQ behavior (avoids asynchronous waiting for messages delivery). See PR #123 for details.

Version 2.4.0 - 2022/12/11

Version 2.3.0 - 2022/12/03

Another pair of improvements by @Quogu:

  • Better compliance: A unique consumer tag is now generated when the calling code does not provide any. See PR #117 for details.
  • Better underlying delivery model (using Tasks). Should reduce deadlock issues in Test code. See PR #118 for details.

Version 2.2.0 - 2022/11/24

  • A few types in the implementation of the fake server are now public. This may prove useful in order to examine the inners of the server for tests purpose. See PR #115 for details.
  • Better compliance: newly declared queues are now bound to RabbitMQ's default exchange. See PR #116 for details.

Version 2.1.0 - 2022/10/11

  • Updated RabbitMQ.Client to version 6.4.0

Version 2.0.0 - 2022/03/12

  • Based on RabbitMQ.Client version 6.2.4

Version 1.5.1 - 2022/03/12

  • Updated dependencies (obviously except for RabbitMQ.Client that is still version 5.2.0)

Version 1.5.0 - 2021/11/10

Mostly cleanup of the codebase as preparatory work for the v6 client implementation

  • Code cleanup:
    • Removed useless overloads and members in FakeModel.
    • Refactored Unit Tests (split IModel tests into several classes, got rid of the Arrange, Act and Assert comments, renamed methods) + added a few ones.
  • No-op implementation in IModel.TxSelect, IModel.TxCommit and IModel.TxRollback instead of throwing.
  • Implemented IModel.MessageCount(queue) and IModel.ConsumerCount(queue) based on QueueDeclarePassive.
  • IModel.QueuePurge now returns the number of purged messages.

Version 1.4.0 - 2021/11/06

This release merges the PR by @inbarbarkai. They are one year-old, and I'm ashamed it took me this long to merge them. Because I'm now watching the repository, I should need less time to react in the future... Once again thanks for his contribution.

  • BUGFIX: #30. QueueDeclarePassive now throws if the queue does not exist. Similarly, ExchangeDeclarePassive throws if the exchange does not exist.
  • FEATURE: #29. Support for the Alternate Exchange Feature.
  • BUGFIX: #28. DefaultBasicConsumer.IsRunning property is now correctly returning true/false.

Version 1.3.2 - 2020/11/23

  • BUGFIX: #27. It was impossible to create a connection after having created and closed a previous connection.

Version 1.3.1 - 2020/11/23

  • BUGFIX: #25. Now it is possible to close a Channel after its connection was closed without the Channel.Close method throwing (this is consistent with how RabbitMQ.Client behaves).

Version 1.3.0 - 2020/11/09

Most of the work in this release was contributed by @inbarbarkai. Thanks to him!

  • As suggested by @inbarbarkai: Basic support for IModel.ConfirmSelect and the IModel.WaitForConfirms* family.
  • Support for IModel.CreateBasicPublishBatch was added thanks to PR #21 by @inbarbarkai.
  • Consumers that implement both IBasicConsumer and IAsyncBasicConsumer are correctly handled by IModel.BasicConsume and IModel.BasicCancel thanks to PR #23 by @inbarbarkai.

Version 1.2.3 - 2020/10/04

  • Renamed from AddUp.RabbitMQ.Fakes to AddUp.FakeRabbitMQ.

Version 1.2.2 - 2020/06/02

  • BUGFIX: Closing a connection could throw if owned models were closed before.

Version 1.2.1 - 2020/05/30

  • Updated to RabbitMQ.Client to version 5.2.0

Version 1.2.0 - 2019/12/11

  • First released version of AddUp.RabbitMQ.Fakes. Based on RabbitMQ.Client version 5.1.2
  • NB: the version starts at 1.2.0 so as not to collide with previous internal versions.

License

This work is provided under the terms of the MIT License.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.8.0 6,941 11/13/2023
2.8.0-beta.1 59 11/12/2023
2.7.0 873 10/16/2023
2.6.0 3,955 3/29/2023
2.5.0 2,254 12/14/2022
2.4.0 765 12/11/2022
2.3.0 720 12/3/2022
2.2.0 1,028 11/24/2022
2.1.0 1,336 10/11/2022
2.0.0 1,465 3/12/2022
2.0.0-beta.1 151 11/12/2021
1.5.1 796 3/12/2022
1.5.0 730 11/10/2021
1.4.0 721 11/6/2021
1.3.2 2,256 11/25/2020
1.3.1 886 11/23/2020
1.3.0 915 11/9/2020
1.2.3 908 10/4/2020