Skip to content

Conversation

rmarinho
Copy link
Member

@rmarinho rmarinho commented Oct 9, 2025

Description of Change

Testing some generated tests

@rmarinho rmarinho requested review from PureWeen and Copilot October 9, 2025 22:32
@rmarinho rmarinho added the area-testing Unit tests, device tests label Oct 9, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces automated test coverage for the .NET MAUI Core project through an AI test generation tool. The PR adds comprehensive unit tests across multiple areas of the codebase to improve test coverage and validate functionality.

Key changes include:

  • Addition of 19 new test files covering various Core components including handlers, primitives, hosting, and utilities
  • Tests for extension methods, data structures, and standard implementations
  • Validation of null parameter handling and edge cases across the framework

Reviewed Changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/Core/tests/UnitTests/WeakReferenceExtensionsTests.cs New comprehensive tests for WeakReference extension methods with null handling and GC scenarios
src/Core/tests/UnitTests/VisualDiagnostics/VisualTreeChangeEventArgsTests.cs New tests validating VisualTreeChangeEventArgs constructor and property assignments
src/Core/tests/UnitTests/Primitives/SwipeDirectionTests.cs New extensive tests for SwipeDirectionHelper methods covering angle calculations and direction mapping
src/Core/tests/UnitTests/Primitives/SafeAreaEdgesTests.cs New comprehensive tests for SafeAreaEdges struct including constructors, equality, and utility methods
src/Core/tests/UnitTests/Primitives/KeyboardTests.cs New tests covering Keyboard static properties and Create method functionality
src/Core/tests/UnitTests/Primitives/EvaluateJavaScriptAsyncCommandTests.cs New tests for EvaluateJavaScriptAsyncRequest constructor behavior
src/Core/tests/UnitTests/Primitives/DimensionTests.cs New tests for Dimension.IsMinimumSet method with various input scenarios
src/Core/tests/UnitTests/Platform/Standard/StrokeExtensionsTests.cs New tests for stroke-related extension methods in standard platform
src/Core/tests/UnitTests/LifecycleEvents/LifecycleEventServiceTests.cs New tests for LifecycleEventService constructor and registration handling
src/Core/tests/UnitTests/ImageSources/FileImageSourceService/FileImageSourceServiceTests.cs New test for FileImageSourceService parameterless constructor
src/Core/tests/UnitTests/Hosting/EssentialsMauiAppBuilderExtensionsTests.cs New tests for Essentials registration and builder functionality
src/Core/tests/UnitTests/Hosting/Fonts/FontsMauiAppBuilderExtensionsTests.cs New comprehensive tests for font initialization and registration
src/Core/tests/UnitTests/Hosting/HybridWebViewServiceCollectionExtensionsTests.cs New test for null parameter validation in HybridWebView extensions
src/Core/tests/UnitTests/Handlers/*/StandardTests.cs New tests for standard handler implementations covering MapXxx methods and CreatePlatformView
Various existing test files Added UTF-8 BOM and formatting corrections

[Trait("Owner", "Code Testing Agent 0.4.133-alpha+a413c4336c")]
[Trait("Category", "auto-generated")]
[Trait("Category", "ProductionBugSuspected")]
public void IndexOfChar_NullString_ThrowsArgumentNullException()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Assert.Throws() Failure: Exception type was not an exact match
Expected: typeof(System.ArgumentNullException)
Actual:   typeof(System.NullReferenceException)
---- System.NullReferenceException : Object reference not set to an instance of an object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-testing Unit tests, device tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants