fix: fix nullable annotations in headless test project.

This commit is contained in:
Dong Bin
2025-02-27 17:15:40 +08:00
parent c09fc6860d
commit 2b344188eb
2 changed files with 9 additions and 5 deletions

View File

@@ -403,7 +403,8 @@ public class PaginationTests
window.Show();
Dispatcher.UIThread.RunJobs();
var buttonsPanel = pagination.GetTemplateChildOfType<Panel>(Pagination.PART_ButtonPanel);
var buttons = buttonsPanel.Children.OfType<PaginationButton>().ToList();
var buttons = buttonsPanel?.Children.OfType<PaginationButton>().ToList();
Assert.NotNull(buttons);
buttons[0].RaiseEvent(new RoutedEventArgs(Button.ClickEvent));
Dispatcher.UIThread.RunJobs();
Assert.Equal(1, count);