Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Jul 15, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions tests/monotouch-test/UIKit/SimpleTextPrintFormatterTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public void DefaultCtor ()
using (var stpf = new UISimpleTextPrintFormatter ()) {
Assert.That (stpf.Handle, Is.Not.EqualTo (IntPtr.Zero), "Handle");
if (TestRuntime.CheckXcodeVersion (11, 0)) {
mandel-macaque marked this conversation as resolved.
Show resolved Hide resolved
Assert.NotNull (stpf.Color, "Color");
Copy link
Member

Choose a reason for hiding this comment

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

I think you need to change the condition in the previous line to be Xcode 14 (and not Xcode 11)

Copy link
Member Author

Choose a reason for hiding this comment

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

I tested it and then did something stupid, clearly

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");
Expand Down Expand Up @@ -62,11 +66,7 @@ public void StringCtor ()
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");
}
}
Expand Down