public void TestEnsureConfig() { string configDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Subversion"); string renamed = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "Subversion.sdlkjhdfgljh"); if (Directory.Exists(renamed)) { Directory.CreateDirectory(renamed); } Directory.Move(configDir, renamed); try { SvnClient client = new SvnClient(); client.LoadConfigurationDefault(); //ClientConfig config = new ClientConfig(); Assert.That(Directory.Exists(configDir)); } finally { Directory.Delete(configDir, true); Directory.Move(renamed, configDir); } }
SvnClient MakeNewSvnClient() { SvnClient client = new SvnClient(); try { // load configuration right away so exceptions during loading can be catched client.LoadConfigurationDefault(); } catch (SvnFormatException) { // workaround for exception "Can't determine the user's config path" for special users like NetworkService // -> try again loading from some specific path client.LoadConfiguration(Path.Combine(Path.GetTempPath(), "SharpSvnApi")); } client.Authentication.UserNameHandlers += (s, e) => e.UserName = _user; client.Authentication.UserNamePasswordHandlers += (s, e) => { e.UserName = _user; e.Password = _password; }; client.Authentication.SslServerTrustHandlers += (s, e) => { e.AcceptedFailures = SharpSvn.Security.SvnCertificateTrustFailures.MaskAllFailures; }; return(client); }
public void HasIgnorePatterns() { SvnClient cl = new SvnClient(); cl.LoadConfigurationDefault(); List <string> items = new List <string>(cl.Configuration.GlobalIgnorePattern); Assert.That(new string[] { "*.a", ".DS_Store", "*.lo" }, Is.SubsetOf(items)); }