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

Refactor + Test Coverage + Nuget Deploy #18

Merged
merged 5 commits into from
Aug 14, 2023
Merged

Refactor + Test Coverage + Nuget Deploy #18

merged 5 commits into from
Aug 14, 2023

Conversation

Axemasta
Copy link
Owner

The CI should now deploy to nuget automatically.

To help test this out i've written some tests for the library. I'm realising there is no way to use the lib without an external provider so I probably need to have a think about the architecture, for now it works for me so will ship this as a prerelease

The release workflow should now deploy the new version to nuget
Written the test cases for the localization manager. I've moved some logic out into its own class since its much easier to test in isolation. Init now returns a value, I'm undecided whether to handle the false in the maui init layer. I will need to test before I decide on that!
Lots of updates, I'm not touching Moq until I know the latest version is actually safe from spyware.
There is now test coverage for this class, I identified a bug where i could save a totally invalid culture because the ctor for cultureinfo doesn't throw. The lib now checks that culture string exists before trying to create culture object
There is now good coverage for this class, turns out i introduced a bug when refactoring so good thing I did these before pr :D
@Axemasta
Copy link
Owner Author

#14 Related

@github-actions
Copy link

File Coverage Lines Branches Missing
All files 25% 21% 28%
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% 14-61
Mocale\MocaleBuilder.cs 0% 0% 0% 6-30
Mocale\MocaleBuilderExtensions.cs 0% 0% 0% 9-72
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 0% 0% 0% 12-98
Mocale\Providers\ResxResourceProvider.cs 0% 0% 0% 14-66
Mocale\Models\AppResourcesConfig.cs 0% 0% 100% 8
Mocale\Models\EmbeddedResourcesConfig.cs 0% 0% 100% 6-10
Mocale\Models\ExternalLocalizationResult.cs 0% 0% 100% 5-7
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 0% 0% 100% 6-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
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 100% 19-35
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 42-70
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 101-132
Mocale.Providers.Azure.Blob\BlobLocalizationProvider.cs 0% 0% 0% 73-94
Mocale.Providers.Azure.Blob\MocaleBuilderExtension.cs 0% 0% 0% 10-28
Mocale.Providers.Azure.Blob\Models\BlobResourceInfo.cs 0% 0% 100% 5-7
Mocale.Providers.Azure.Blob\Models\BlobStorageConfig.cs 0% 0% 100% 8-20
Mocale.Providers.Azure.Blob\Managers\BlobResourceLocator.cs 0% 0% 0% 21-56
Mocale.Providers.Azure.Blob\Managers\BlobResourceLocator.cs 0% 0% 0% 64-90

Minimum allowed coverage is 5%

Generated by 🐒 cobertura-action against 4e4ab67

@Axemasta Axemasta merged commit 151845a into main Aug 14, 2023
@Axemasta Axemasta deleted the nuget branch August 15, 2023 08:51
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