xamarin-macios/tests/monotouch-test/Foundation/NSObject.cs

28 строки
564 B
C#
Исходник Обычный вид История

#if __MACOS__
2016-05-26 16:06:52 +03:00
using System;
using System.Threading;
2016-05-26 16:06:52 +03:00
using NUnit.Framework;
using AppKit;
using ObjCRuntime;
using Foundation;
using CoreGraphics;
namespace Xamarin.Mac.Tests
{
[TestFixture]
[Preserve (AllMembers = true)]
2016-05-26 16:06:52 +03:00
public class NSObjectTests
{
[Test]
public void NSObjectTests_InvokeTest ()
2016-05-26 16:06:52 +03:00
{
bool hit = false;
NSApplication.SharedApplication.Invoke (() => hit = true, 1);
TestRuntime.RunAsync (TimeSpan.FromSeconds (10), () => { }, () => hit);
Assert.IsTrue (hit, "Did not see events after 10 seconds");
2016-05-26 16:06:52 +03:00
}
}
}
#endif // __MACOS__