-
Notifications
You must be signed in to change notification settings - Fork 542
Add comprehensive tests for CGImageProperties classes #23041
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
Assert.AreEqual ("Test 測試 Software", tiff.Software, "Software should handle unicode"); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Always add a new line at the end of files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit ffed716. Added newlines at the end of all test files.
[Test] | ||
public void ConstructorWithDictionaryTest () | ||
{ | ||
var dict = new NSMutableDictionary (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use using ...
for disposable classes. NSMutableDictionary is disposable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit ffed716. Wrapped NSMutableDictionary in using statements for proper disposal in all test files.
public void IntegrationWithCGImagePropertiesTest () | ||
{ | ||
// Test that CGImageProperties can access Exif properties | ||
string file = Path.Combine (NSBundle.MainBundle.ResourcePath, "basn3p08.png"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use var
whenever possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit ffed716. Using var for type inference where possible throughout all test files.
{ | ||
// Test default constructor | ||
var exif = new CGImagePropertiesExif (); | ||
Assert.IsNotNull (exif, "Default constructor should create a valid instance"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use NUnit v4 syntax (Assert.That ...)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit ffed716. Converted all Assert.AreEqual/IsNotNull/IsNull calls to NUnit v4 syntax using Assert.That with Is.EqualTo/Is.Not.Null/Is.Null across all test files.
using System; | ||
using Foundation; | ||
#if MONOMAC | ||
using AppKit; | ||
#else | ||
using UIKit; | ||
#endif | ||
using CoreGraphics; | ||
using NUnit.Framework; | ||
using System.IO; | ||
using CoreImage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Place usings in three blocks: first System*, then macios frameworks (AppKit, CoreGraphics, UIKit, etc.), finally NUnit*. Also sort the usings in each block alphabetically. Do this for each new file in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit ffed716. Reorganized using statements in all test files into three blocks: System* (sorted alphabetically), then macios frameworks (CoreGraphics, CoreImage, Foundation, AppKit/UIKit), then NUnit*, all sorted alphabetically within each block.
- Reorganize using statements: System*, then macios frameworks, then NUnit* - Convert Assert.AreEqual/IsNotNull/IsNull to NUnit v4 syntax (Assert.That) - Use 'using' statements for NSMutableDictionary (disposable) - Add newlines at end of all test files - Use 'var' where appropriate Addresses feedback from @rolfbjarne in PR review comments. Co-authored-by: rolfbjarne <249268+rolfbjarne@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This comment has been minimized.
This comment has been minimized.
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
[Test] | ||
public void ConstructorWithDictionaryTest () | ||
{ | ||
using (var dict = new NSMutableDictionary ()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the "using" declaration syntax instead of the using block syntax to reduce nesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 8f80441. Converted all using blocks to using declarations throughout all CGImageProperties test files to reduce nesting.
Co-authored-by: mandel-macaque <2190086+mandel-macaque@users.noreply.github.com>
✅ [CI Build #8f80441] Build passed (Build packages) ✅Pipeline on Agent |
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
✅ [CI Build #8f80441] Build passed (Detect API changes) ✅Pipeline on Agent |
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
✅ API diff for current PR / commit.NET ( No breaking changes )✅ API diff vs stable.NET ( No breaking changes )ℹ️ Generator diffGenerator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes) Pipeline on Agent |
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
🔥 [CI Build #8f80441] Build failed (Build macOS tests) 🔥Build failed for the job 'Build macOS tests' (with job status 'Failed') Pipeline on Agent |
@vs-mobiletools-engineering-service2 Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub. You can ask me to try again later by mentioning me in a new comment. If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: Sorry for the inconvenience! |
This PR adds comprehensive test coverage for CGImageProperties classes that were previously missing tests, as requested in issue #17315.
Changes Made
New Test Files Created:
Enhanced Existing Test:
Test Coverage Details
Each test file includes:
Example Test Usage
Test Statistics
The tests will be automatically included in the build due to existing include patterns in the project files (
$(MonoTouchTestDirectory)\**\*.cs
).Fixes #17315.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.