public void Path_ParsePaths() { SvnUriTarget ut; SvnPathTarget pt; SvnTarget st; Assert.That(SvnUriTarget.TryParse("http://svn.apache.org/repos/asf/subversion/", out ut)); Assert.That(ut.Revision, Is.EqualTo(SvnRevision.None)); Assert.That(SvnUriTarget.TryParse("http://svn.apache.org/repos/asf/subversion/@123", out ut)); Assert.That(ut.Revision, Is.EqualTo(SvnRevision.None)); Assert.That(ut.TargetName.Contains("@")); Assert.That(SvnUriTarget.TryParse("http://svn.apache.org/repos/asf/subversion/@123", true, out ut)); Assert.That(ut.Revision, Is.EqualTo((SvnRevision)123L)); Assert.That(SvnPathTarget.TryParse("C:\\A", out pt)); Assert.That(pt.Revision, Is.EqualTo(SvnRevision.None)); Assert.That(SvnPathTarget.TryParse("C:\\A@123", out pt)); Assert.That(pt.Revision, Is.EqualTo(SvnRevision.None)); Assert.That(pt.TargetName.Contains("@")); Assert.That(SvnPathTarget.TryParse("C:\\@123", true, out pt)); Assert.That(pt.Revision, Is.EqualTo((SvnRevision)123L)); Assert.That(SvnTarget.TryParse("http://svn.apache.org/repos/asf/subversion/", out st)); Assert.That(st, Is.InstanceOf(typeof(SvnUriTarget))); Assert.That(SvnTarget.TryParse("http://svn.apache.org/repos/asf/subversion/@123", out st)); Assert.That(st, Is.InstanceOf(typeof(SvnUriTarget))); Assert.That(SvnTarget.TryParse("http://svn.apache.org/repos/asf/subversion/@123", true, out st)); Assert.That(st, Is.InstanceOf(typeof(SvnUriTarget))); Assert.That(SvnTarget.TryParse("C:\\A", out st)); Assert.That(st, Is.InstanceOf(typeof(SvnPathTarget))); Assert.That(SvnTarget.TryParse("C:\\A@123", out st)); Assert.That(st, Is.InstanceOf(typeof(SvnPathTarget))); Assert.That(SvnTarget.TryParse("C:\\@123", true, out st)); Assert.That(st, Is.InstanceOf(typeof(SvnPathTarget))); }
public void Path_TryParseShouldReturnFalse() { SvnPathTarget pt; Assert.That(SvnPathTarget.TryParse("http://qqn.nl/2233234", out pt), Is.False); }