Skip to content

Conversation

@eNeRGy164
Copy link
Contributor

Added for Stream

  • [Not]BeWritable
  • [Not]BeSeekable
  • [Not]BeReadable
  • [Not]BeReadOnly
  • [Not]BeWriteOnly
  • [Not]HaveLength
  • [Not]HavePosition

Added for BufferedStream

  • [Not]HaveBufferSize

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.

@dennisdoomen dennisdoomen requested a review from jnyrup May 7, 2021 13:18
Copy link
Member

@jnyrup jnyrup left a comment

Choose a reason for hiding this comment

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

It was a joy to review this 😍

Comment on lines +328 to +329
.ForCondition(!Subject.CanWrite && Subject.CanRead)
.FailWith("but it was writable or not readable.")
Copy link
Member

Choose a reason for hiding this comment

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

Would it make sense to split this into two ForCondition+FailWith such that the error message can specify which condition was not met?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was my original intention and also to do it with only one chain, but couldn't get it working. Settled for this version to keep the implementation simple for now.

Will think a bit on this.

* Renamed unit tests
* Rewritten some text
* Changed some parameters to long
* Changed null message to include 'reference' instead of type
* Fixed typo
* Added because(args) to bufferedstream tests
@dennisdoomen
Copy link
Member

Oh, and I forgot to say that I usually make a comment only once, and expect the author to check the rest of the code for the same symptom...

@jnyrup jnyrup linked an issue May 8, 2021 that may be closed by this pull request
@jnyrup jnyrup merged commit a836758 into fluentassertions:develop May 8, 2021
@eNeRGy164 eNeRGy164 deleted the stream-assertions branch May 8, 2021 11:26
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.

[Request] Custom validations on 'Stream' types

3 participants