예제 #1
0
        public void PlatformToSystemException(float width, float height)
        {
#if __IOS__
            var platform = new CoreGraphics.CGSize(width, height);
            Assert.Throws <ArgumentOutOfRangeException>(() => platform.ToSystemSize());
#elif WINDOWS_UWP
            var platform = new Windows.Foundation.Size(width, height);
            Assert.Throws <ArgumentOutOfRangeException>(() => platform.ToSystemSize());
#endif
        }
예제 #2
0
        public void PlatformToSystemF()
        {
#if __IOS__
            var platform = new CoreGraphics.CGSize(width, height);
            var system   = platform.ToSystemSize();
#elif __ANDROID__
            var platform = new Android.Util.SizeF(width, height);
            var system   = platform.ToSystemSizeF();
#else
            var platform = new Windows.Foundation.Size(width, height);
            var system   = platform.ToSystemSize();
#endif

            Assert.Equal(width, system.Width);
            Assert.Equal(height, system.Height);
        }