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

Support OneOfBase<T0, T1, ...> on FluentAssertions.OneOf #2

Open
julealgon opened this issue Nov 5, 2020 · 0 comments
Open

Support OneOfBase<T0, T1, ...> on FluentAssertions.OneOf #2

julealgon opened this issue Nov 5, 2020 · 0 comments

Comments

@julealgon
Copy link

julealgon commented Nov 5, 2020

  • Library: FluentAssertions.OneOf
  • Version: 0.0.5

Just downloaded your library in hopes that it would improve my unit tests without having to create custom FluentAssertions validators for my response objects.

However, I'm relying on custom responses like this:

public abstract class MyResponse : OneOfBase<MyResponse.Success1, MyResponse.Error1, MyResponse.Error2>
{
    public sealed class Success1 : MyResponse {}
    ...
}

As you can probably tell, the extensions in this library do not trigger for my type, because I'm not using the OneOf<T> type, but its base OneOfBase<T>.

Could you please change the validation extensions to consider the base type instead, so that both raw OneOf as well as discriminated union custom classes can be used?

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

No branches or pull requests

1 participant