Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added InverseFishForMessage and nuget package fluent-assertions #5430

Merged
merged 1 commit into from
Dec 15, 2021
Merged

Added InverseFishForMessage and nuget package fluent-assertions #5430

merged 1 commit into from
Dec 15, 2021

Conversation

brah-mcdude
Copy link
Contributor

This pull request is based on a thread I had with @Aaronontheweb on Gitter: https://gitter.im/akkadotnet/akka.net?at=61ae5b0acd3f06175df32eda.

@Aaronontheweb Aaronontheweb added the akka-testkit Akka.NET Testkit issues label Dec 15, 2021
@Aaronontheweb Aaronontheweb added this to the 1.4.30 milestone Dec 15, 2021
Copy link
Member

@Aaronontheweb Aaronontheweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - left behind some nitpicks but we can deal with those in separate PRs

@@ -11,6 +11,7 @@

<ItemGroup>
<EmbeddedResource Include="Configs\TestScheduler.conf;Internal\Reference.conf" />
<PackageReference Include="FluentAssertions" Version="5.10.3" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably just take a dependency on FluentAssertions in the TestKit. I don't know why we haven't yet.

I'll make a bigger issue for this and we'll revisit that prior to releasing v1.4.30.

@@ -56,6 +58,23 @@ public T FishForMessage<T>(Predicate<T> isMessage, TimeSpan? max = null, string
}
}

/// <summary>
/// Receives messages until <paramref name="max"/>. Ignores all messages except for a message of type <typeparamref name="T"/>. Asserts that all messages are not of the of type <typeparamref name="T"/>. Note that when comparing types, inheritance is ignored, in other words, only perfectly matching types are asserted.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to format this into a few separate lines.

/// <typeparam name="T">The type that the message is not supposed to be.</typeparam>
/// <param name="probe"></param>
/// <param name="max"></param>
public async static Task InverseFishForMessage<T>(TestProbe probe, TimeSpan? max = null)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably name this ReceiveUntil, FishUntil or something like that.

@Aaronontheweb Aaronontheweb merged commit 7e48e35 into akkadotnet:dev Dec 15, 2021
Aaronontheweb added a commit to Aaronontheweb/akka.net that referenced this pull request Dec 15, 2021
Aaronontheweb added a commit that referenced this pull request Dec 17, 2021
* Make updates to `FishUntil`

Implement nitpicks from #5430

* Nitpick

* cleaned up `FishUntilMessage`

* removed `FluentAssertions` reference

* fixed bad `TestKit.ReceiveTests`
Aaronontheweb added a commit to Aaronontheweb/akka.net that referenced this pull request Dec 20, 2021
* Make updates to `FishUntil`

Implement nitpicks from akkadotnet#5430

* Nitpick

* cleaned up `FishUntilMessage`

* removed `FluentAssertions` reference

* fixed bad `TestKit.ReceiveTests`
Aaronontheweb added a commit that referenced this pull request Dec 20, 2021
)

* remove the forced waiting on the underlying transport to start up

* racy spec fix: `BackoffOnRestartSupervisor_must_respect_maxNrOfRetries_property_of_OneForOneStrategy` (#5442)

issue was that using `AutoReset` could cause a race where if the scheduler could reset the count in-flight and throw off the estimates used by the tests. Using a `ManualReset` avoids this issue.

* deleted commented out code

* Make updates to `FishUntil` (#5433)

* Make updates to `FishUntil`

Implement nitpicks from #5430

* Nitpick

* cleaned up `FishUntilMessage`

* removed `FluentAssertions` reference

* fixed bad `TestKit.ReceiveTests`

* Custom frame size computation support in Framing (#5444)

* Custom frame size computation support in Framing

* Speed up of framing spec

* optimize `Props` `NewExpression` allocations (#5428)

per #5416 (comment)

Co-authored-by: Ismael Hamed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
akka-testkit Akka.NET Testkit issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants