question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expected, Actual message for shouldNotContain

See original GitHub issue

I have been using the Collection.shouldNotContain method to verify that my Collection does NOT contain an item.

However I found the output on fail quite confusing:

image

It shows the item that I do not want to be in the Collection as Expected, and the Collection as actual.

In other words it looks as if it was actually expected that the item was in the Collection.

I will probably look into this soon.

Also let’s make some progress on common assertions like String.shouldNotBeNullOrBlank !

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MarkusAmshovecommented, Feb 19, 2017

Alright.

The change will be shipped with 1.15

0reactions
AndreasVolkmanncommented, Feb 17, 2017

Well I do believe that the latter one looks better, but once the collection size gets larger than your screen, it will not immediately be obvious what the problem is.

So I guess version one!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tips - Fluent Assertions
Expected True, but found False. Expected collection to contain only items matching (x.OtherProperty == value(UnitTests2.CollectionTests+<>c ...
Read more >
Assertion - Go Packages
ShouldEqual receives exactly two parameters and does an equality check using the following semantics: 1. If the expected and actual values ...
Read more >
should | Cypress Documentation
These string messages will be shown in the Command Log giving each assertion more context. Expect assertions with messages. Compare text values of...
Read more >
Expect / Should - Chai Assertion Library
However, it's often best to assert that the target is strictly ( === ) or deeply equal to its expected value.
Read more >
tests: Assertion arguments should be passed in the correct order
assertEquals(runner.exitCode(), 0, "Unexpected exit code"); // Noncompliant; Yields error message like: Expected:<-1>. Actual:<0>. org.assertj.core.api.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found