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

Added bUnit extention and test examples to Toast #117

Merged
merged 12 commits into from
Aug 6, 2021
Merged

Added bUnit extention and test examples to Toast #117

merged 12 commits into from
Aug 6, 2021

Conversation

OliverBack
Copy link
Collaborator

@OliverBack OliverBack commented Jun 11, 2021

  • Added BUnitToastTestExtensions helper to register toast services
  • Added sample tests
  • Added unit tests for Toast Service

@chrissainty
Copy link
Member

@egil do you have any thoughts on the bUnit test extensions?

@egil
Copy link

egil commented Jun 11, 2021

@egil do you have any thoughts on the bUnit test extensions?

More questions :-)

I was expecting to see a fake implementation of IToastService, that would record any calls made to it display toasts, and allow users to assert against it. What are the ideas behind this approach?

@chrissainty
Copy link
Member

@egil Yep. That's a fair point. We got a little bit carried away here in hindsight. You're correct, we don't need to actually render the toasts at all. We'll rework this.

@egil
Copy link

egil commented Jun 15, 2021

@egil Yep. That's a fair point. We got a little bit carried away here in hindsight. You're correct, we don't need to actually render the toasts at all. We'll rework this.

Been there done that. My suggestion is to create a fake service that has a few query methods that users can easily combine with their assertion framework of choice.

Created TestExtensions project
updated ci-pr.yml build step
@OliverBack
Copy link
Collaborator Author

@egil Thanks!
We have updated the approach as per your suggestion. What do you think?

Copy link

@egil egil left a comment

Choose a reason for hiding this comment

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

Here is a few suggestions for you.

src/Blazored.Toast.TestExtensions/InMemoryToastService.cs Outdated Show resolved Hide resolved
src/Blazored.Toast.TestExtensions/InMemoryToastService.cs Outdated Show resolved Hide resolved
src/Blazored.Toast.TestExtensions/InMemoryToastService.cs Outdated Show resolved Hide resolved
src/Blazored.Toast.TestExtensions/InMemoryToast.cs Outdated Show resolved Hide resolved
src/Blazored.Toast.TestExtensions/InMemoryToast.cs Outdated Show resolved Hide resolved
@anitagov
Copy link

@chrissainty - Any idea when this PR will be completed?

Co-authored-by: Egil Hansen <egil@assimilated.dk>
@chrissainty
Copy link
Member

I'm hoping very soon. @OliverBack any ideas when we'll be done on this?

Co-authored-by: Egil Hansen <egil@assimilated.dk>
@OliverBack
Copy link
Collaborator Author

@chrissainty, @anitagov Hopefully have the pr ready for today

@chrissainty chrissainty added the Feature New feature that will be added to the project label Aug 6, 2021
@chrissainty chrissainty merged commit 80037fd into Blazored:main Aug 6, 2021
@anitagov
Copy link

Thanks for adding this feature @chrissainty .
Will try to migrate to using this in September. My current approach for testing Toast messages with bunit is having issues as Blazored Toast tests fail when I run tests together or in the pipeline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature that will be added to the project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants