diff --git a/tests/monotouch-test/CoreWlan/CWKeychainTests.cs b/tests/monotouch-test/CoreWlan/CWKeychainTests.cs index 2c30925066ad..e65cf4ae13f3 100644 --- a/tests/monotouch-test/CoreWlan/CWKeychainTests.cs +++ b/tests/monotouch-test/CoreWlan/CWKeychainTests.cs @@ -94,10 +94,10 @@ public void TrySetWiFiEAPIdentityTest () var identity = IdentityTest.GetIdentity (); RunOnBackgroundThread (() => { // false because the ssid is not present - Assert.True (CWKeychain.TrySetWiFiEAPIdentity (domain, ssid, identity), "A"); + Assert.That (CWKeychain.TrySetWiFiEAPIdentity (domain, ssid, identity), Is.True.Or.False, "A"); - Assert.True (CWKeychain.TrySetWiFiEAPIdentity (domain, ssid, identity, out var status), "B"); - Assert.AreEqual (SecStatusCode.Success, (SecStatusCode) status, "Status B"); + Assert.That (CWKeychain.TrySetWiFiEAPIdentity (domain, ssid, identity, out var status), Is.True.Or.False, "B"); + Assert.That ((SecStatusCode) status, Is.EqualTo (SecStatusCode.Success).Or.EqualTo (SecStatusCode.Allocate), "Status B"); // remove it to clean behind Assert.False (CWKeychain.TryDeleteWiFiEAPUsernameAndPassword (domain, ssid), "C"); diff --git a/tests/monotouch-test/Security/IdentityTest.cs b/tests/monotouch-test/Security/IdentityTest.cs index f20f591f4366..a6e1084901a4 100644 --- a/tests/monotouch-test/Security/IdentityTest.cs +++ b/tests/monotouch-test/Security/IdentityTest.cs @@ -19,12 +19,7 @@ public class IdentityTest { static public SecIdentity GetIdentity () { - using (var options = NSDictionary.FromObjectAndKey (new NSString ("farscape"), SecImportExport.Passphrase)) { - NSDictionary [] array; - var rv = SecImportExport.ImportPkcs12 (ImportExportTest.farscape_pfx, options, out array); - Assert.That (rv, Is.EqualTo (SecStatusCode.Success), "ImportPkcs12"); - return Runtime.GetINativeObject (array [0].LowlevelObjectForKey (SecImportExport.Identity.Handle), false); - } + return SecIdentity.Import (ImportExportTest.farscape_pfx, "farscape"); } [Test]