Order by multiple properties sequentially by Serg046 · Pull Request #1416 · fluentassertions/fluentassertions · GitHub
Skip to content

Order by multiple properties sequentially#1416

Merged
dennisdoomen merged 4 commits into
fluentassertions:developfrom
Serg046:issue-1160
Oct 28, 2020
Merged

Order by multiple properties sequentially#1416
dennisdoomen merged 4 commits into
fluentassertions:developfrom
Serg046:issue-1160

Conversation

@Serg046

@Serg046 Serg046 commented Oct 27, 2020

Copy link
Copy Markdown
Contributor

IMPORTANT

  • The code complies with the Coding Guidelines for C#.
  • The changes are covered by a new or existing set of unit tests which follow the Arrange-Act-Assert syntax such as is used in this example.
  • If the contribution adds a feature or fixes a bug, please update the release notes, which are published on the website.
  • If the contribution changes the public API the changes needs to be included by running AcceptApiChanges.ps1/AcceptApiChanges.sh.
  • If the contribution affects the documentation, please include your changes in this pull request so the documentation will appear on the website.

Issue #1160

@Serg046

Serg046 commented Oct 27, 2020

Copy link
Copy Markdown
Contributor Author

@dennisdoomen dennisdoomen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍 Nice work.
❌ Please update the title to be functional

namespace FluentAssertions.Collections
{
[DebuggerNonUserCode]
public class SubsequentOrderingGenericCollectionAssertions<T> :

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🔧 Maybe rename it to SubsequentOrderingAssertions?

Comment thread docs/_pages/releases.md Outdated
* Added `ComparingBy{Members,Value}(Type)` to allow specifying open generic types - [#1389](https://github.com/fluentassertions/fluentassertions/pull/1389).
* Added overload of `CollectionAssertions.NotBeEquivalentTo` that takes a `config` parameter` - [#1408](https://github.com/fluentassertions/fluentassertions/pull/1408).
* Changed `StringAssertions.StartWith`, `StringAssertions.EndWith` and their `EquivalentOf` versions to allow empty strings - [#1413](https://github.com/fluentassertions/fluentassertions/pull/1413).
* Added ThenBeInAscendingOrder and ThenBeInDescendingOrder to allow asserting that a subsequence is ordered in ascending or descending order - [#1416](https://github.com/fluentassertions/fluentassertions/pull/1416).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🙃 Would be nice to format those names using back-ticks.

#region Then be in order

[Fact]
public void When_asserting_subsequence_by_then_be_in_ascending_order_it_should_pass()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

🤔 Try to keep the names of test functional and never refer to the literal name of a method or API, e.g.

When_the_collection_is_ordered_according_to_the_subsequent_ordering_assertion_it_should_succeed

@jnyrup jnyrup left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Does this support multiple ThenBeInAscendingOrder?
E.g.

collection.Should()
	.BeInAscendingOrder(x => x.Item1)
	.And
	.ThenBeInAscendingOrder(x => x.Item2)
	.And
	.ThenBeInAscendingOrder(x => x.Item3);

@Serg046

Serg046 commented Oct 28, 2020

Copy link
Copy Markdown
Contributor Author

@Serg046 Serg046 changed the title Issue 1160 Order by multiple properties sequentially Oct 28, 2020
@dennisdoomen dennisdoomen merged commit 0a1fa2c into fluentassertions:develop Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants