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

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

2016-05-26 16:06:52 +03:00
// Copyright 2011-2012 Xamarin Inc. All rights reserved
#if !__WATCHOS__ && !MONOMAC
2016-05-26 16:06:52 +03:00
using System;
using System.Drawing;
using System.Reflection;
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 ImageViewTest {
[Test]
public void InitWithFrame ()
{
var frame = new CGRect (10, 10, 100, 100);
2016-05-26 16:06:52 +03:00
using (UIImageView iv = new UIImageView (frame)) {
Assert.That (iv.Frame, Is.EqualTo (frame), "Frame");
}
}
[Test]
public void AnimationImages ()
{
using (var i1 = new UIImage ())
using (var i2 = new UIImage ())
using (var v = new UIImageView ()) {
v.AnimationImages = new UIImage[] { i1, i2 };
// no need for [PostGet] since it does not change other properties
Assert.Null (v.Image, "Image");
Assert.Null (v.HighlightedImage);
}
}
[Test]
public void HighlightedAnimationImages_BackingFields ()
{
using (var i1 = new UIImage ())
using (var i2 = new UIImage ())
using (var v = new UIImageView ()) {
v.HighlightedAnimationImages = new UIImage[] { i1, i2 };
// no need for [PostGet] since it does not change other properties
Assert.Null (v.Image, "Image");
Assert.Null (v.HighlightedImage);
}
}
}
}
#endif // !__WATCHOS__