-
-
Notifications
You must be signed in to change notification settings - Fork 539
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
Add ThatAre[Not]Structs
in TypeSelector.cs
#2056
Add ThatAre[Not]Structs
in TypeSelector.cs
#2056
Conversation
ThatAre[Not]Struct
in TypeSelector.cs
as mentioned in Issue #645
Co-authored-by: IT-VBFK <49762557+IT-VBFK@users.noreply.github.com>
ThatAre[Not]Struct
in TypeSelector.cs
as mentioned in Issue #645ThatAre[Not]Struct
in TypeSelector.cs
…TypeSelectorStructFeature
Pull Request Test Coverage Report for Build 3731314363Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
@@ -495,6 +496,42 @@ public void When_selecting_types_that_are_not_classes_it_should_return_the_corre | |||
.And.Contain(typeof(NotOnlyClassesEnumeration)); | |||
} | |||
|
|||
[Fact] | |||
public void When_selecting_types_that_are_structs_it_should_return_the_correct_types() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 What about record structs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i will extend the tests for record structs and i think it should work fine with record structs as well.
ThatAre[Not]Struct
in TypeSelector.cs
ThatAre[Not]Structs
in TypeSelector.cs
docs/_pages/releases.md
Outdated
@@ -11,8 +11,11 @@ sidebar: | |||
|
|||
### What's new | |||
* Added `ThatAre[Not]Abstract` method for filtering the types - [#2058](https://github.com/fluentassertions/fluentassertions/pull/2058) | |||
* Added `ThatAre[Not]Abstract` methods to `MethodInfoSelector.cs` for filtering the methods - [#2060](https://github.com/fluentassertions/fluentassertions/pull/2060) | |||
* Added `ThatAre[Not]Struct` method for Types Filter - [#2056](https://github.com/fluentassertions/fluentassertions/pull/2056) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo ;-)
From my comment in #2061 (comment)
In IL there is no direct concept the C# keyword public struct Foo{}
So like Some points of the implementation
To summarize: |
I see, there is really a problem with the half and complex types. |
On the other hand, a lot of developers may not even be aware of all those special cases and just want to know which of their types in their code base are |
You are right, i also didn't know about these special types that C# offer, but to be honest i'm also new in C# .NET technologies and coming from java. |
As we don't know all future or custom numeric types, we cannot filter them out. To avoid any ambiguities we could have |
Yes, let's do that. @94sedighi what do you think? |
@dennisdoomen It will cover a wider range of types, but we can do it, and there are no edge cases, as far as I know the C#. |
IMPORTANT