Skip to content

Conversation

@Rosuavio
Copy link
Contributor

@Rosuavio Rosuavio commented Apr 6, 2021

Fixes Adds tests for the range selector properties.

Added unit tests for code interactions with the range selector properties.

PR Type

What kind of change does this PR introduce?

What is the current behavior?

No tests for the RangeSelector properties.

What is the new behavior?

Tests for the RangeSelector properties.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • Pull Request has been submitted to the documentation repository instructions. Link:
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@ghost
Copy link

ghost commented Apr 6, 2021

Thanks RosarioPulella for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌

@ghost ghost requested review from Kyaa-dost, azchohfi and michael-hawker April 6, 2021 19:53
@Rosuavio Rosuavio closed this Apr 6, 2021
@Rosuavio Rosuavio reopened this Apr 6, 2021
Copy link
Contributor Author

@Rosuavio Rosuavio left a comment

Choose a reason for hiding this comment

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

@azchohfi I added this code to be able to use this syntax for defining a record for these tests. From what I read it seem like its not a big hack or anything, do you think its fine to add? It should only effect our testing code.

@Rosuavio
Copy link
Contributor Author

@azchohfi @Sergio0694 @michael-hawker @shweaver-MSFT @deltakosh @skendrot I am still looking to expand these tests, but I would like some feedback. Any thoughts about what behavior this shows in the RangeSelector or if the test code would be greatly appreciated.

@azchohfi
Copy link
Contributor

I loved that you used the equality of records to Assert results, but I'm not sure about the benefits with this solution, versus the complexity. I'm assuming you did this just to make sure that the test is asserting only one thing, but I would be fine to assert each property individually just for the simplicity. Not sure what others think. I'm not saying I'm not ok with this implementation (and its workaround for records in dot net native), but I'm not sure if it is really a benefit here. You have the parameter values in the same method, and you could just assert them individually. I'm fine with either.

@Rosuavio
Copy link
Contributor Author

I loved that you used the equality of records to Assert results, but I'm not sure about the benefits with this solution, versus the complexity. I'm assuming you did this just to make sure that the test is asserting only one thing, but I would be fine to assert each property individually just for the simplicity.

I want to assert on the equality of all the properties together as a record so that if any of the values are not as expected then instead of seeing the just one value that is not expected we get to see the values of all the properties, giving use more information in CI without us having to expand the test manually or set break points. For this control its generally important because for many of the properties if you change one it could effect others.

@azchohfi
Copy link
Contributor

IMO, that is enough explanation to keep it this way then! Makes sense!

@michael-hawker
Copy link
Member

I like the idea that a failure provides all the info about the case that's failing compared to a single value too.

Let's snap this in if we think they're good, then work towards adding more cases or adjusting cases to what we want the desired behavior to be (especially around the snap points). Then we can use that to make modifications to the existing logic (as we know they're broken cases).

@michael-hawker michael-hawker added this to the 7.1 milestone Apr 22, 2021
@Rosuavio Rosuavio marked this pull request as ready for review April 22, 2021 20:46
@michael-hawker michael-hawker mentioned this pull request Apr 22, 2021
8 tasks
@Rosuavio
Copy link
Contributor Author

Rosuavio commented May 7, 2021

In 9df2a34, I removed the DisplayNames from the DataRows as I felt it would not be maintained consistently and did not provide much additional info. If anyone liked it let me know so we can discuss.

@Rosuavio
Copy link
Contributor Author

Rosuavio commented May 7, 2021

@michael-hawker @azchohfi and @chingucoding mind looking at this, I would like to get this merged so we can move forward with discussing, addressing issues and adjusting behavior and around the RangeSelector

Copy link
Contributor

@marcelwgn marcelwgn left a comment

Choose a reason for hiding this comment

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

Changes look good to me. Of course it's not great to have so many data rows, but it's good that we are testing this so thoroughly.

@ghost
Copy link

ghost commented May 13, 2021

Hello @michael-hawker!

Because this pull request has the auto merge :zap: label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ghost ghost merged commit a5ce322 into CommunityToolkit:main May 13, 2021
@Rosuavio Rosuavio deleted the rangeselector-tests branch May 14, 2021 03:27
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants