예제 #1
0
        public void TestTranslate()
        {
            var offset = new CGPoint(5.6, 7.8);
            var result = _rect.Translate(offset);

            AssertUtilsIOS.AreEqualCGRect(new CGRect(_rect.X + offset.X, _rect.Y + offset.Y, _rect.Width, _rect.Height),
                                          result);
        }
예제 #2
0
        public void TestScale()
        {
            var factor = new CGSize(500, 600);
            var result = _rect.Scale(factor);

            AssertUtilsIOS.AreEqualCGRect(
                new CGRect(_rect.X * factor.Width, _rect.Y * factor.Height, _rect.Width * factor.Width,
                           _rect.Height * factor.Height), result);
        }
예제 #3
0
        public void TestNormalize()
        {
            var rect   = new CGRect(500, 600, 700, 800);
            var size   = new CGSize(900, 1000);
            var result = rect.Normalize(size);

            AssertUtilsIOS.AreEqualCGRect(
                new CGRect(rect.X / size.Width, rect.Y / size.Height, rect.Width / size.Width,
                           rect.Height / size.Height), result);
        }
예제 #4
0
        public void TestToCGRect()
        {
            var result = _rect.ToCGRect();

            AssertUtilsIOS.AreEqualCGRect(new CGRect(0.1, 0.1, 1.1, 1.1), result);
        }