-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement Unit & Behaviour Tests For Main Library #53
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying all of the config stuff fires and gets updated correctly
These test all of the cases when registering providers, I did find some typos for exceptions which is good
I don't think these tests do too much... but its nice to know this stuff is getting invoked!
The enum key helper and extension methods now have coverage
All of the uncovered internal providers now have tests. I've added some logging to the resx provider so its more clear whats going on inside!
Testing this turned out to be a huge hassle. The TryAppend method was a bit pep and didn't behave at all how I would of expected it to! I've refactored it to validate the uri string on the way out since creating an absolute uri will never throw an exception regardless of how bad the input string is!
Replaced this with TimeProvider instead since its part of .NET. I tested the only class using it so should be a lift n shift!
The private asset malarkey was an utter failure, lets just depend on things!
Whilst working on the bindable object extensions I've found an issue whilst testing. When the culture changes the dispatcher for the control is null and the test fails, before I delve into setting up a secure test bed I'll check in the stuff that works!
There is now full coverage for the TranslateBinding extensions. I've also refactored the code so that the fluent extensions call the void underneath, making it a 1 stop shop for the code!
The final tests for the BindableObjectExtension methods have been implemented, alot of tests!
I've moved the whole static parameterization / binding crap out of this extension. It was stupid and I now have a much better way of doing it! Maybe I'll bring the static parameters back in a seperate extension!
I've done tests for the localize binding extension, whilst doing this I saw the need for a base class that all of the localize extensions share so I've added that. I've also made LocalizeExtension return Binding, not BindingBase because it didn't need the conversion!
I forgot to have bespoke tests for the convert methods to just pass through all of the branches in isolation aswell as in integration (with the BO extensions).
There are now full tests for the enum localization, I've also added an exception that will throw when you use it on a non enum value because obviously you should be told off when you try!
Full coverage for all of the localization extensions, I need to do a code version of the multibinding, plus integration style tests!
Theres some whacky behaviour where when I dont cast to string the parameterisation formats the temperature weirdly in french. Probably what I've dont doesn't really satisfy the longterm vision of the project, but for now it works...
There is now a code safe way of setting multi locale bindings. I've tested all of this and also changes all code extensions to use the markup extensions so everything is running through the same core code!
Reduced some warnings in the unit tests project and I've upped the coverage for the translator manager
There are now tests for the translation resolver, there was a tiny logic hole here that I've plugged
Previously when you changed language if it failed to load the external file for any reason, the library wouldn't bother loading the local files even if they do exist. I've sorted that out now so both get loaded and then it evaluates and updates accordingly.
347849c
to
e47c099
Compare
Mocale now sets thread cultures, its been wonky testing this so hopefully its ok
This has been a mare! I've put the dispose pattern in and also fixed how it cleans up cultures
Minimum allowed coverage is Generated by 🐒 cobertura-action against 5c38ea8 |
This was referenced Mar 4, 2025
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've tested the vast majority of the api surface for the core functionality of Mocale.
The coverage of the main library is now at 98%, I have full tests for all of the markup & binding extensions including behavioural tests that verify all of the functionality working as intended.
I've refactored where neccessary to pass tests, remove warnings. I've fixed #21 since this was quite an overstep when first developing the library. I've replaced the
IDateTime
wrapper withTimeProvider
(#52).I would say the library is now complete enough for a major release, but I will handle that in a separate pr!
This also satisfies #5 to a degree, in the future I will cover the external providers but they shouldn't be as much work!