[Tests] Fix an monotouch-test test that landed broken. (#15503)

This commit is contained in:
Manuel de la Pena 2022-07-15 11:18:01 -04:00 коммит произвёл GitHub
Родитель 12925a7952
Коммит 161de84bcf
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 6 удалений

Просмотреть файл

@ -30,7 +30,11 @@ namespace MonoTouchFixtures.UIKit {
{
using (var stpf = new UISimpleTextPrintFormatter ()) {
Assert.That (stpf.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle");
if (TestRuntime.CheckXcodeVersion (11, 0)) {
if (TestRuntime.CheckXcodeVersion (14, 0)) {
Assert.NotNull (stpf.Color, "Color");
Assert.NotNull (stpf.Font, "Font");
Assert.That (stpf.TextAlignment, Is.EqualTo (UITextAlignment.Natural), "TextAlignment");
} else if (TestRuntime.CheckXcodeVersion (11, 0)) {
Assert.NotNull (stpf.Color, "Color");
Assert.Null (stpf.Font, "Font");
Assert.That (stpf.TextAlignment, Is.EqualTo (UITextAlignment.Natural), "TextAlignment");
@ -62,11 +66,7 @@ namespace MonoTouchFixtures.UIKit {
Assert.That (stpf.Color, Is.EqualTo (UIColor.Black), "Color");
Assert.That (stpf.TextAlignment, Is.EqualTo (UITextAlignment.Left), "TextAlignment");
}
if (TestRuntime.CheckXcodeVersion (14, 0)) {
Assert.Null (stpf.Font, "Font");
} else {
Assert.NotNull (stpf.Font, "Font");
}
Assert.NotNull (stpf.Font, "Font");
Assert.That (stpf.Text, Is.EqualTo ("Xamarin"), "Text");
}
}