Replace Locator with AppLocator and update dependencies#3
Replace Locator with AppLocator and update dependencies#3glennawatson merged 16 commits intomainfrom
Conversation
Refactored code to use AppLocator instead of Locator for dependency resolution across Avalonia integration projects. Updated several package versions, including Avalonia to 11.3.5, ReactiveUI to 21.0.1, Splat to 16.2.1, and others, to ensure compatibility and access to the latest features and fixes.
… expand test coverage for ReactiveUI.Avalonia (#4) * Initial plan * Fix target frameworks and migrate from xUnit to NUnit Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Complete NUnit migration and fix test execution Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Expand test coverage with additional NUnit tests Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Changes before error encountered Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Clean up unused test dependencies and maintain CentralPackageTransitivePinningEnabled Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Restore target frameworks to netstandard2.0;net8.0;net9.0 and fix Microsoft2.Tests Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Significantly expand test coverage with 45 comprehensive tests Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Restore target frameworks to netstandard2.0;net8.0;net9.0 for all non-test projects Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> * Fix GitHub Actions build issues: update NUnit.Analyzers version and remove duplicate PackageReferences Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com> --------- Co-authored-by: ChrisPulman <4910015+ChrisPulman@users.noreply.github.com>
Standardized the ordering of using directives and updated variable declarations to use 'var' where appropriate across multiple test files. These changes improve code consistency and readability in the test suite.
Removed redundant DryIoc2 and Microsoft2 test projects and consolidated Microsoft1 test project under a new name. Added new unit tests for Avalonia mixins, activation, property observables, data template hooks, and reactive view controls. Updated InternalsVisibleTo attributes to allow test access, and expanded test target frameworks to include net9.0.
Added Microsoft.NET.Test.Sdk, NUnit, and NUnit3TestAdapter package references to Splat.Avalonia.DryIoc1.Tests, Splat.Avalonia.Microsoft1.Tests, and Splat.Avalonia.Tests projects. This ensures all test projects have explicit dependencies for running tests and collecting coverage.
Moved test framework and coverage tool package references from individual test project files to Directory.build.props for centralized management. This simplifies dependency management and ensures consistency across test projects.
Test framework dependencies were removed from Directory.build.props and added directly to each test project's .csproj file to ensure proper resolution on CI, especially on Linux. Adjusted build target conditions, set LangVersion to preview in ReactiveUI.Avalonia, suppressed some StyleCop warnings, and removed trivial test methods from test files.
Added the coverlet.msbuild package to Splat.Avalonia test projects to enable code coverage collection during test runs. This ensures consistent code coverage tooling across all test projects.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
There was a problem hiding this comment.
Pull Request Overview
This PR refactors Avalonia integration projects by migrating from the legacy Locator service locator to the new AppLocator pattern for dependency resolution. Additionally, it modernizes the project structure with updated package versions including Avalonia 11.3.5, ReactiveUI 21.0.1, and Splat 16.2.1, while streamlining the test infrastructure by migrating from XUnit to NUnit and consolidating test projects.
Key changes include:
- Replace all
Locator.CurrentandLocator.CurrentMutablereferences withAppLocatorequivalents - Update dependency package versions across all projects
- Add comprehensive NUnit test suite covering ReactiveUI Avalonia functionality
Reviewed Changes
Copilot reviewed 36 out of 37 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ReactiveUI.Avalonia/AppBuilderExtensions.cs | Updated dependency resolution from Locator to AppLocator |
| Splat.Avalonia.*.csproj | Added project references and updated target frameworks |
| Splat.Avalonia.*/AvaloniaMixins.cs | Migrated all DI container setup methods to use AppLocator |
| Directory.Packages.props | Updated package versions and removed unused dependencies |
| Multiple test files | Added comprehensive NUnit test coverage for Avalonia integration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
What kind of change does this PR introduce?
update
What is the new behavior?
Refactored code to use AppLocator instead of Locator for dependency resolution across Avalonia integration projects. Updated several package versions, including Avalonia to 11.3.5, ReactiveUI to 21.0.1, Splat to 16.2.1, and others, to ensure compatibility and access to the latest features and fixes.
What might this PR break?
Unreleased version
Please check if the PR fulfills these requirements
Other information: