Skip to content

Issue 477 with unit tests#531

Merged
thudugala merged 2 commits intothudugala:masterfrom
LeoJHarris:issue-477-with-unit-tests
May 6, 2025
Merged

Issue 477 with unit tests#531
thudugala merged 2 commits intothudugala:masterfrom
LeoJHarris:issue-477-with-unit-tests

Conversation

@LeoJHarris
Copy link
Copy Markdown
Contributor

@LeoJHarris LeoJHarris commented May 6, 2025

What does this PR do?

Initial Unit Testing project setup, includes NotificationImageTests & LocalNotificationCenterTests, also attempt to resolve #477 with additional null checking for the NotificationImage.cs Binary property.

Fatal Exception: android.runtime.JavaProxyThrowable
[System.NullReferenceException]: Object reference not set to an instance of an object
Plugin.LocalNotification.NotificationImage.get_HasValue
Why are we doing this? Any context or related work?

LeoJHarris added 2 commits May 6, 2025 15:42
- Refined `.gitignore` to exclude additional files and directories.
- Upgraded Visual Studio solution to version 17 and added unit test project.
- Improved `LocalNotificationCenter` to clear large image binaries.
- Made `Binary` property in `NotificationImage` nullable for better handling.
- Enhanced `HasValue` property to safely check for null binaries.
- Added assembly attribute for internal visibility in unit tests.
- Introduced global using directives for cleaner code.
- Updated unit test project to target .NET 8.0 with necessary package references.
- Added `dotnet_logo.png` for testing resources.
- Created new unit tests for serialization logic and image handling.
- Updated `xunit.runner.json` to include the latest schema.
- Removed unnecessary namespaces from GlobalUsing.cs.
- Enhanced documentation in LocalNotificationCenterTests.cs.
- Introduced new test for clearing large image binaries.
- Modified existing tests for clarity and correctness.
- Added new test for NotificationImage file path validation.
- Updated serializer handling for null NotificationImage.
@thudugala thudugala merged commit 343d1c3 into thudugala:master May 6, 2025
@LeoJHarris LeoJHarris mentioned this pull request May 8, 2025
@LeoJHarris
Copy link
Copy Markdown
Contributor Author

LeoJHarris commented May 8, 2025

Hi @thudugala,

Just wanted to gently nudge on the possibility of a new release that includes the fix from this recently merged PR. hopefully this resolves a high-impact crash affecting about 7% of our user sessions. A release, even a pre-release, would be hugely beneficial for us. We're happy to help test and monitor. Thanks!

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.

System.NullReferenceException on Show (11.1.0)

2 participants