示例#1
0
        [Culture("en")]          // this setting depends on locale of the device according to apple docs on MACaptionAppearanceGetDisplayType, we know english works
        public void GetDisplayType()
        {
            if (!TestRuntime.CheckSystemAndSDKVersion(7, 0))
            {
                Assert.Ignore("requires iOS7+");
            }

            Assert.That(MACaptionAppearance.GetDisplayType(MACaptionAppearanceDomain.Default), Is.EqualTo(MACaptionAppearanceDisplayType.Automatic), "Default");
        }
        public void DidDisplayCaptions()
        {
            TestRuntime.AssertXcodeVersion(11, 0);

            // there's a known bug with UIPasteboard and NSAttributedString - and it makes our tests hang
            var nsa = new NSAttributedString  [0];

            MACaptionAppearance.DidDisplayCaptions(nsa);
            nsa = new [] { new NSAttributedString("Bonjour") };
            MACaptionAppearance.DidDisplayCaptions(nsa);
            nsa = null;
            MACaptionAppearance.DidDisplayCaptions(nsa);

            var a = new string [0];

            MACaptionAppearance.DidDisplayCaptions(a);
            a = new [] { "Hello", "World" };
            MACaptionAppearance.DidDisplayCaptions(a);
            a = null;
            MACaptionAppearance.DidDisplayCaptions(a);
        }
        [Culture("en")]          // this setting depends on locale of the device according to apple docs on MACaptionAppearanceGetDisplayType, we know english works
        public void GetDisplayType()
        {
            TestRuntime.AssertXcodeVersion(5, 0, 1);

            Assert.That(MACaptionAppearance.GetDisplayType(MACaptionAppearanceDomain.Default), Is.EqualTo(MACaptionAppearanceDisplayType.Automatic).Or.EqualTo(MACaptionAppearanceDisplayType.AlwaysOn).Or.EqualTo(MACaptionAppearanceDisplayType.ForcedOnly), "Default");
        }