Skip to content

Adds tests to verify enum behavior when un/mapped - #496

Merged
austindrenski merged 2 commits into
npgsql:devfrom
austindrenski:enum-nonissue-tests
Jul 2, 2018
Merged

austindrenski merged 2 commits into
npgsql:devfrom
austindrenski:enum-nonissue-tests

Conversation

@austindrenski

@austindrenski austindrenski commented Jun 29, 2018 •

Copy link
Copy Markdown
Contributor
  • Adds tests to demonstrate the behavior of mapped and unmapped enums.
  • Adds a test to document an unsupported cast on an unmapped enum.

Related: #489

@austindrenski austindrenski added the documentation Improvements or additions to documentation label Jun 29, 2018
@austindrenski austindrenski added this to the 2.1.1 milestone Jun 29, 2018
@austindrenski austindrenski self-assigned this Jun 29, 2018
@austindrenski austindrenski added test and removed documentation Improvements or additions to documentation labels Jun 29, 2018
@austindrenski
austindrenski requested a review from roji July 1, 2018 17:29

@roji roji 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.

LGTM, it's good to increase coverage like you're doing.

}

[Fact]
public void Where_with_unmapped_enum_parameter_downcast_for_int_comparison_does_matter()

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.

Like I wrote on a previous I'm issue, I'm not sure of the value of having negative tests like this - but I'm OK with it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I figured it would help monitor changes in type handling at the provider-level, and parameter handling for EF Core in general. I'm also thinking about adding some info on this issue to the enum mapping docs that would link here for an example. The idea being that if something changes, this test will start to fail (in a good way!) and we can update the docs accordingly.

But I could also accomplish this with an untracked file in my fork. Let me know if you change your mind and want to omit it, I'm good either way.

@roji roji modified the milestones: 2.1.1, 2.1.2 Jul 1, 2018
@austindrenski
austindrenski merged commit f293450 into npgsql:dev Jul 2, 2018
@austindrenski
austindrenski deleted the enum-nonissue-tests branch July 2, 2018 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants