From d37c762c7435f19f989f4d5b87d308fe2dd686bc Mon Sep 17 00:00:00 2001 From: therzok Date: Thu, 11 Aug 2016 22:06:11 +0300 Subject: [Mac] Try using a temporary keychain for the credentials tests. Bug 43283: --- .../tests/MacPlatform.Tests/CredentialsProviderTests.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 (); -- cgit v1.2.3