public void GetRootNoAddPositive2() { string path1 = "/path1/bob"; string path2 = "/path2/claire"; RestUriPart target = new RestUriPart(); RestUriPart_Accessor a = RestUriPart_Accessor.AttachShadow(target); var p1 = target.Add(path1); var p2 = target.Add(path2); RestUriPart actual = target.GetPart(path1); Assert.IsNotNull(actual); Assert.AreEqual(p1, actual, "{0} != {1}", p1.Uri, actual.Uri); }
public void GetRootNoAddPositive() { string path1 = "/path1/"; string path2 = "/path2/"; RestUriPart target = new RestUriPart(); RestUriPart_Accessor a = RestUriPart_Accessor.AttachShadow(target); var p1 = target.Add(path1); var p2 = target.Add(path2); RestUriPart actual = target.GetRoot(path1); Assert.IsNotNull(actual); Assert.AreEqual(p1, actual); }
public void GetPartChild() { string path1 = "/path1/bob"; string path2 = "/path2/claire"; RestUriPart target = new RestUriPart(); RestUriPart_Accessor a = RestUriPart_Accessor.AttachShadow(target); var p1 = target.Add(path1); var p2 = target.Add(path2); RestUriPart actual = target.GetPart(path1); Assert.IsNotNull(actual); Assert.AreEqual(p1, actual); }
public void GetPartChildWithReplaceable() { string path1 = "/path1/{bob}/blah"; string path1ToGet = "/path1/hello/blah"; string path2 = "/path2/claire"; RestUriPart target = new RestUriPart(); RestUriPart_Accessor a = RestUriPart_Accessor.AttachShadow(target); var p1 = target.Add(path1); var p2 = target.Add(path2); RestUriPart actual = target.GetPart(path1ToGet); Assert.IsNotNull(actual); Assert.AreEqual(p1, actual); }