Fixes #3109. AOT support with .Net 8. (#3638)

* Add a native AOT project.

* Fixes Text.Json to work with native AOT.

* Fix silent errors on unit tests when testing the Red color which has a length of 3.

* Allowing test custom configuration without the config.json file match the unit tests configurations.

* Fix unit test if tested alone.

* Add native project into solution.

* Fix merge errors.

* Setting ConfigurationManager.ThrowOnJsonErrors as true to throw any serialization issue when published file runs.

* Remove unnecessary using's.

* Added unit test to ensure all serialization is properly configured.

* Fix warnings.

* Remove ThrowOnJsonErrors.

* Fix warnings.

---------

Co-authored-by: Tig <tig@users.noreply.github.com>
This commit is contained in:
BDisp
2024-08-06 19:05:36 +01:00
committed by GitHub
parent 1b973eed5a
commit 63e75b7413
27 changed files with 443 additions and 82 deletions

View File

@@ -29,13 +29,18 @@ public class ThemeScopeTests
{
Reset ();
Assert.NotEmpty (Themes);
Assert.Equal (Alignment.End, Dialog.DefaultButtonAlignment);
Alignment savedValue = Dialog.DefaultButtonAlignment;
Alignment newValue = Alignment.Center != savedValue ? Alignment.Center : Alignment.Start;
Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = Alignment.Center;
Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = newValue;
ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply ();
Assert.Equal (Alignment.Center, Dialog.DefaultButtonAlignment);
Reset ();
Assert.Equal (newValue, Dialog.DefaultButtonAlignment);
// Replace with the savedValue to avoid failures on other unit tests that rely on the default value
Themes ["Default"] ["Dialog.DefaultButtonAlignment"].PropertyValue = savedValue;
ThemeManager.Themes! [ThemeManager.SelectedTheme]!.Apply ();
Assert.Equal (savedValue, Dialog.DefaultButtonAlignment);
}
[Fact]