diff options
author | therzok <marius.ungureanu@xamarin.com> | 2016-08-11 22:06:11 +0300 |
---|---|---|
committer | Marius Ungureanu <marius.ungureanu@xamarin.com> | 2016-08-11 23:00:54 +0300 |
commit | d37c762c7435f19f989f4d5b87d308fe2dd686bc (patch) | |
tree | 13f43238c805637762536c1fec0bad7b590eed3d | |
parent | a03168dc750e4359163b142e1a85a4b491feed16 (diff) |
[Mac] Try using a temporary keychain for the credentials tests.
Bug 43283:
-rw-r--r-- | main/tests/MacPlatform.Tests/CredentialsProviderTests.cs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/main/tests/MacPlatform.Tests/CredentialsProviderTests.cs b/main/tests/MacPlatform.Tests/CredentialsProviderTests.cs index 698651e0f2..94c183927a 100644 --- a/main/tests/MacPlatform.Tests/CredentialsProviderTests.cs +++ b/main/tests/MacPlatform.Tests/CredentialsProviderTests.cs @@ -24,6 +24,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. using System; +using MonoDevelop.MacInterop; using NUnit.Framework; namespace MacPlatform.Tests @@ -31,6 +32,22 @@ namespace MacPlatform.Tests [TestFixture] public class CredentialsProviderTests : MonoDevelop.Core.BaseCredentialsProviderTests { + static string TestKeyChain = "ThisIsMonoDevelopsPrivateKeyChainForTests"; + + [TestFixtureSetUp] + public void FixtureSetup () + { + Keychain.TryDeleteKeychain (TestKeyChain); + Keychain.CurrentKeychain = Keychain.CreateKeychain (TestKeyChain, "mypassword"); + } + + [TestFixtureTearDown] + public void FixtureTeardown () + { + Keychain.DeleteKeychain (Keychain.CurrentKeychain); + Keychain.CurrentKeychain = IntPtr.Zero; + } + protected override MonoDevelop.Core.IPasswordProvider GetPasswordProvider () { return new MonoDevelop.MacIntegration.MacKeychainPasswordProvider (); |