-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a255b0
commit f96dd9d
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/Silverback.Integration.Tests/Messaging/Broker/ConsumerStatusInfoFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) 2020 Sergio Aquilini | ||
// This code is licensed under MIT license (see LICENSE file for details) | ||
|
||
using System.Linq; | ||
using FluentAssertions; | ||
using Silverback.Messaging.Broker; | ||
using Xunit; | ||
|
||
namespace Silverback.Tests.Integration.Messaging.Broker | ||
{ | ||
public class ConsumerStatusInfoFixture | ||
{ | ||
[Fact] | ||
public void History_ShouldBeRolledOver() | ||
{ | ||
ConsumerStatusInfo statusInfo = new(); | ||
|
||
for (int i = 0; i < 5; i++) | ||
{ | ||
statusInfo.SetConnected(); | ||
statusInfo.SetDisconnected(); | ||
} | ||
|
||
statusInfo.History.Should().HaveCount(10); | ||
statusInfo.History.First().Status.Should().Be(ConsumerStatus.Connected); | ||
|
||
statusInfo.SetConnected(); | ||
|
||
statusInfo.History.Should().HaveCount(10); | ||
statusInfo.History.First().Status.Should().Be(ConsumerStatus.Disconnected); | ||
} | ||
} | ||
} |