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

Fix crash when only using local provider #36

Merged
merged 5 commits into from
Dec 21, 2023
Merged

Fix crash when only using local provider #36

merged 5 commits into from
Dec 21, 2023

Conversation

Axemasta
Copy link
Owner

As reported in #35, the library didnt work when UseExternalProvider was set to false.

I have added a "fake" external provider that will be registered when in local only mode, to fix the di issue without significant changes in plumbing.

I've added some extra tests to cover the embedded resource loader aswell as fill in coverage for the changes made to the localization manager.

I never tested this but the initialization crashes when opting out of external providers because no IExternalLocalizationProvider interface is registered in the translator resolver. I have fixed this and added some config points in the main manager.
We now have test coverage for the config changes I made to support local only mode
Since it was returning new collections when it should have been returning null, causing issues upstream
I managed to get away without using it, but here we go. Kiss goodbye to fast builds!
Now it all wants to stop working, crickey
Copy link

File Coverage Lines Branches Missing
All files 35% 32% 38%
Mocale.Cache.SQLite\MocaleBuilderExtension.cs 0% 0% 100% 11-33
Mocale.Cache.SQLite\Repositories\CacheRepository.cs 0% 0% 0% 13-94
Mocale.Cache.SQLite\Repositories\RepositoryBase.cs 0% 0% 100% 6-18
Mocale.Cache.SQLite\Repositories\TranslationsRepository.cs 0% 0% 0% 12-163
Mocale.Cache.SQLite\Providers\DatabaseConnectionProvider.cs 0% 0% 100% 16-50
Mocale.Cache.SQLite\Providers\DatabasePathProvider.cs 0% 0% 100% 8-18
Mocale.Cache.SQLite\Models\SqliteConfig.cs 0% 0% 100% 5-9
Mocale.Cache.SQLite\Managers\LocalisationCacheManager.cs 0% 0% 0% 18-55
Mocale.Cache.SQLite\Managers\SqlCacheUpdateManager.cs 0% 0% 0% 15-78
Mocale.Cache.SQLite\Entities\TranslationItem.cs 0% 0% 100% 10-16
Mocale.Cache.SQLite\Entities\UpdateHistoryItem.cs 0% 0% 100% 10-14
Mocale\AppBuilderExtensions.cs 0% 0% 0% 17-69
Mocale\MocaleBuilder.cs 0% 0% 0% 6-30
Mocale\MocaleBuilderExtensions.cs 0% 0% 0% 18-119
Mocale\MocaleInitializeService.cs 0% 0% 100% 6-13
Mocale\MocaleLocator.cs 0% 0% 100% 31-42
Mocale\Wrappers\DateTimeWrapper.cs 0% 0% 100% 10
Mocale\Providers\EmbeddedResourceProvider.cs 88% 94% 83% 76-78
Mocale\Providers\InactiveExternalLocalizationProvider.cs 0% 0% 100% 7-14
Mocale\Providers\ResxResourceProvider.cs 0% 0% 0% 14-66
Mocale\Parsers\ResxLocalizationParser.cs 87% 100% 75%
Mocale\Models\AppResourcesConfig.cs 0% 0% 100% 8
Mocale\Models\EmbeddedResourcesConfig.cs 0% 0% 100% 6-10
Mocale\Models\MocaleConfiguration.cs 91% 83% 100% 7
Mocale\Managers\ConfigurationManager.cs 0% 0% 100% 11-21
Mocale\Managers\TranslationResolver.cs 0% 0% 0% 19-180
Mocale\Managers\TranslationResolver.cs 0% 0% 100% 100-116
Mocale\Managers\TranslationResolver.cs 0% 0% 0% 38-92
Mocale\Managers\TranslatorManager.cs 93% 93% 93% 41 102 121
Mocale\Extensions\DictionaryExtension.cs 95% 100% 90%
Mocale\Extensions\LocalizeExtension.cs 0% 0% 100% 9-37
Mocale\Extensions\TaskExtensions.cs 87% 100% 75%
Mocale\Extensions\UriExtension.cs 62% 25% 100% 12-25
Mocale\Exceptions\InitializationException.cs 0% 0% 100% 6-8
Mocale\Exceptions\MocaleException.cs 0% 0% 100% 6-13
Mocale.Providers.AWS.S3\MocaleBuilderExtension.cs 0% 0% 100% 8-20
Mocale.Providers.AWS.S3\S3BucketProvider.cs 0% 0% 0% 11-49
Mocale.Providers.AWS.S3\Models\BucketConfig.cs 0% 0% 100% 5-8
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 100% 20-40
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 47-74
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 104-135
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 77-97
Mocale.Providers.Azure.Blob\MocaleBuilderExtension.cs 0% 0% 0% 16-31
Mocale.Providers.Azure.Blob\Models\BlobResourceInfo.cs 0% 0% 100% 5-7
Mocale.Providers.Azure.Blob\Models\BlobStorageConfig.cs 0% 0% 100% 7-16
Mocale.Providers.Azure.Blob\Managers\BlobResourceLocator.cs 0% 0% 0% 21-58
Mocale.Providers.Azure.Blob\Managers\BlobResourceLocator.cs 0% 0% 0% 66-92
Mocale.Providers.GitHub.Raw\GitHubRawProvider.cs 44% 39% 50% 46-53 61-67 75-83
Mocale.Providers.GitHub.Raw\MocaleBuilderExtension.cs 0% 0% 0% 14-32

Minimum allowed coverage is 5%

Generated by 🐒 cobertura-action against a3dd715

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant