コード例 #1
0
ファイル: PolicyTest.cs プロジェクト: ye-man/xamarin-macios
		void CreatePolicy (NSString oid, NSString propertyOid = null)
		{
			string name = oid + ".";
			using (var policy = SecPolicy.CreatePolicy (oid, null)) {
				Assert.That (CFGetRetainCount (policy.Handle), Is.EqualTo ((nint) 1), name + "RetainCount");
				Assert.That (policy.GetProperties ().Values [0].ToString (), Is.EqualTo ((string) (propertyOid ?? oid)), name + "SecPolicyOid");
			}
		}
コード例 #2
0
        public void CreateUnknownPolicy()
        {
            TestRuntime.AssertXcodeVersion(5, 0);

            using (var oid = new NSString("1.2.3.4")) {
                Assert.Throws <ArgumentException> (delegate {
                    SecPolicy.CreatePolicy(oid, null);
                });
            }
        }
コード例 #3
0
ファイル: PolicyTest.cs プロジェクト: ye-man/xamarin-macios
		public void CreateUnknownPolicy ()
		{
			TestRuntime.AssertXcodeVersion (5, 0);
			TestRuntime.AssertSystemVersion (PlatformName.MacOSX, 10, 9, throwIfOtherPlatform: false);

			using (var oid = new NSString ("1.2.3.4")) {
				Assert.Throws<ArgumentException> (delegate {
					SecPolicy.CreatePolicy (oid, null);
				});
			}
		}
コード例 #4
0
        public void CreateUnknownPolicy()
        {
            if (!TestRuntime.CheckSystemAndSDKVersion(7, 0))
            {
                Assert.Inconclusive("requires iOS7");
            }

            using (var oid = new NSString("1.2.3.4")) {
                Assert.Throws <ArgumentException> (delegate {
                    SecPolicy.CreatePolicy(oid, null);
                });
            }
        }