-
-
Notifications
You must be signed in to change notification settings - Fork 92
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
ShowToast return instance #210
base: main
Are you sure you want to change the base?
Conversation
…tance has Close() method. - fix CustomToast ques
@chrissainty I am not sure how to adjust unit testing (I never wrote any) on these new events that now return an instance. Do you know anyone who could help with that?
|
I wouldn't mock anything. I'd render a real toast instance verify its there then call close on the instance and verify it's now gone. That way the test will be testing real stuff and no mocks |
As i said i never do any kind of unit testing, now it fails because OnShow and every other event returns instance instead of void and i don't know how to change them
OnShow has to return instance and to my zero knowledge on unit testing i could only make it work with code i posted.
And btw. I wanted you to check if this is even an option for this feature to return ToastInstance |
No worries. I might be able to get a bit of time this evening to get on the laptop. I'll do my best to write up an example. |
@Cvijo Sorry I've not been able to help with this for so long. I think the mock instance will do for now. I can rework the tests once we merge things if there are any major issues. |
@chrissainty this is the first draft of this feature.
I have fixed some bugs with custom toasts (they did now follow MaxToastCount rule and queue logic)
In code I have put my comments for some changes and will remove them when we agree on them, they all start with
//todo remove comment after review
`
I am not sure about toastInstance.Dispose(), can you check if that is fine with you, if yes i will have to implement those on ClearAll methods too.
Here is screen shoot.
Novi.videozapis.mp4