2016-05-26 16:06:52 +03:00
|
|
|
// Copyright 2011 Xamarin Inc. All rights reserved
|
|
|
|
|
2017-10-31 19:09:21 +03:00
|
|
|
#if !__TVOS__ && !__WATCHOS__ && !MONOMAC
|
2016-05-26 16:06:52 +03:00
|
|
|
|
|
|
|
using System;
|
|
|
|
using System.Drawing;
|
2020-05-28 17:35:09 +03:00
|
|
|
using CoreGraphics;
|
2016-05-26 16:06:52 +03:00
|
|
|
using Foundation;
|
|
|
|
using UIKit;
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
namespace MonoTouchFixtures.UIKit {
|
|
|
|
|
|
|
|
[TestFixture]
|
|
|
|
[Preserve (AllMembers = true)]
|
|
|
|
public class SwitchTest {
|
|
|
|
|
|
|
|
[Test]
|
|
|
|
public void InitWithFrame ()
|
|
|
|
{
|
2020-05-28 17:35:09 +03:00
|
|
|
var frame = new CGRect (10, 10, 100, 100);
|
2016-05-26 16:06:52 +03:00
|
|
|
using (UISwitch s = new UISwitch (frame)) {
|
|
|
|
Assert.That (s.Frame.X, Is.EqualTo (frame.X), "X");
|
|
|
|
Assert.That (s.Frame.Y, Is.EqualTo (frame.Y), "Y");
|
|
|
|
// Width and Height are set by the Switch (e.g. 79 x 27 for the iPhone)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // !__TVOS__ && !__WATCHOS__
|