private void OnChangedProps(object sender, ReposHookEventArgs e) { using (SvnLookClient look = new SvnLookClient()) { int i = 0; look.InheritedPropertyList(e.HookArgs.LookOrigin, "trunk/A/mu", delegate(object sender2, SvnLookInheritedPropertyListEventArgs ee) { switch (i++) { case 0: Assert.That(ee.Path, Is.EqualTo("trunk")); Assert.That(ee.Properties.Contains("root-A")); break; case 1: Assert.That(ee.Path, Is.EqualTo("trunk/A")); Assert.That(ee.Properties.Contains("A-A")); break; case 2: Assert.That(ee.Path, Is.EqualTo("trunk/A/mu")); Assert.That(ee.Properties.Contains("mu-A")); break; default: throw new InvalidOperationException("Too many invocations"); } }); Assert.That(i, Is.GreaterThan(0), "No props listed"); } }
public void LookInheritedProps() { SvnSandBox sbox = new SvnSandBox(this); Uri uri = sbox.CreateRepository(SandBoxRepository.Greek); using (InstallHook(uri, SvnHookType.PreCommit, OnChangedProps)) { Client.RepositoryOperation(new Uri(uri, "trunk"), delegate(SvnMultiCommandClient cl) { cl.SetProperty("", "root-A", "B"); cl.SetProperty("A", "A-A", "C"); cl.SetProperty("A/mu", "mu-A", "D"); }); } using (SvnLookClient look = new SvnLookClient()) { int i = 0; look.InheritedPropertyList(new SvnLookOrigin(uri.LocalPath, 2), "trunk/A/mu", delegate(object sender2, SvnLookInheritedPropertyListEventArgs ee) { switch (i++) { case 0: Assert.That(ee.Path, Is.EqualTo("trunk")); Assert.That(ee.Properties.Contains("root-A")); break; case 1: Assert.That(ee.Path, Is.EqualTo("trunk/A")); Assert.That(ee.Properties.Contains("A-A")); break; case 2: Assert.That(ee.Path, Is.EqualTo("trunk/A/mu")); Assert.That(ee.Properties.Contains("mu-A")); break; default: throw new InvalidOperationException("Too many invocations"); } }); Assert.That(i, Is.GreaterThan(0), "No props listed"); } }