2020-12-18 13:45:06 +03:00
#if __MACOS__
using System ;
2016-05-26 16:06:52 +03:00
using NUnit.Framework ;
using AppKit ;
using ObjCRuntime ;
using Foundation ;
2022-11-10 19:59:26 +03:00
namespace Xamarin.Mac.Tests {
2021-03-16 17:15:30 +03:00
[Preserve (AllMembers = true)]
2022-11-10 19:59:26 +03:00
public class NSTextFieldTests {
2016-05-26 16:06:52 +03:00
NSTextField textField ;
[SetUp]
public void SetUp ( )
{
textField = new NSTextField ( ) ;
}
[Test]
public void NSTextFieldShouldChangePlaceholderString ( )
{
Asserts . EnsureYosemite ( ) ;
var placeholder = textField . PlaceholderString ;
textField . PlaceholderString = "Test" ;
Assert . IsFalse ( textField . PlaceholderString = = placeholder , "NSTextFieldShouldChangePlaceholderString - Failed to set the PlaceholderString property" ) ;
}
[Test]
public void NSTextFieldShouldChangePlaceholderAttributedString ( )
{
Asserts . EnsureYosemite ( ) ;
var placeholder = textField . PlaceholderAttributedString ;
textField . PlaceholderAttributedString = new NSAttributedString ( "Test" ) ;
Assert . IsFalse ( textField . PlaceholderAttributedString = = placeholder , "NSTextFieldShouldChangePlaceholderAttributedString - Failed to set the PlaceholderAttributedString property" ) ;
}
}
2020-12-18 13:45:06 +03:00
}
#endif // __MACOS__