xamarin-macios/tests/monotouch-test/UIKit/ApplicationTest.cs

63 строки
1.5 KiB
C#
Исходник Обычный вид История

2016-05-26 16:06:52 +03:00
// Copyright 2011-2012 Xamarin Inc. All rights reserved
#if !__WATCHOS__
using System;
using System.Drawing;
#if XAMCORE_2_0
using Foundation;
using UIKit;
using ObjCRuntime;
#else
using MonoTouch.Foundation;
using MonoTouch.UIKit;
using MonoTouch.ObjCRuntime;
#endif
using NUnit.Framework;
namespace MonoTouchFixtures.UIKit {
[TestFixture]
[Preserve (AllMembers = true)]
public class ApplicationTest {
[Test]
public void BackgroundTaskInvalid ()
{
Assert.That (UIApplication.BackgroundTaskInvalid.ToString () == "0", "#1");
Assert.That (UIApplication.BackgroundTaskInvalid == 0, "#2");
}
#if !__TVOS__
[Test]
public void SetKeepAliveTimeout_Null ()
{
Assert.False (UIApplication.SharedApplication.SetKeepAliveTimeout (600, null), "SetKeepAliveTimeout");
}
#endif
[Test]
public void BeginBackgroundTask_Null ()
{
var taskid = UIApplication.SharedApplication.BeginBackgroundTask (null);
Assert.That (taskid, Is.Not.EqualTo (UIApplication.BackgroundTaskInvalid), "BeginBackgroundTask");
UIApplication.SharedApplication.EndBackgroundTask (taskid);
}
[Test]
public void MinimumKeepAliveTimeout ()
{
// NSTimeInternal (double) not NSString
Assert.That (UIApplication.MinimumKeepAliveTimeout, Is.EqualTo (600.0), "MinimumKeepAliveTimeout");
}
[Test]
public void SendAction_Null ()
{
UIApplication.SharedApplication.SendAction (new Selector ("someSelector"), null, null, null);
}
}
}
#endif // !__WATCHOS__