Example #1
0
        public void PlatformToSystemException(float x, float y, float height, float width)
        {
#if __IOS__
            var platform = new CoreGraphics.CGRect(x, y, height, width);
            Assert.Throws <ArgumentOutOfRangeException>(() => platform.ToSystemRectangle());
#elif WINDOWS_UWP
            var platform = new Windows.Foundation.Rect(x, y, height, width);
            Assert.Throws <ArgumentOutOfRangeException>(() => platform.ToSystemRectangle());
#endif
        }
Example #2
0
        public void PlatformToSystemException(float x, float y, float width, float height)
        {
#if __IOS__
            var platform = new CoreGraphics.CGRect(x, y, width, height);
            Assert.Throws <ArgumentOutOfRangeException>(() => platform.ToSystemRectangle());
#elif __ANDROID__
            var platform = new Android.Graphics.Rect((int)x, (int)y, (int)width, (int)height);
            Assert.Throws <ArgumentOutOfRangeException>(() => platform.ToSystemRectangle());
#elif WINDOWS_UWP
            var platform = new Windows.Foundation.Rect(x, y, width, height);
            Assert.Throws <ArgumentOutOfRangeException>(() => platform.ToSystemRectangle());
#endif
        }
Example #3
0
        public void PlatformToSystem()
        {
#if __IOS__
            var platform = new CoreGraphics.CGRect(x, y, width, height);
#elif __ANDROID__
            var platform = new Android.Graphics.Rect(x, y, x + width, y + height);
#else
            var platform = new Windows.Foundation.Rect(x, y, width, height);
#endif
            var system = platform.ToSystemRectangle();

            Assert.Equal(x, system.X);
            Assert.Equal(y, system.Y);
            Assert.Equal(width, system.Width);
            Assert.Equal(height, system.Height);
        }