Ejemplo n.º 1
0
        public void AssureNavigateToRelativeResource()
        {
            var rl = new ResourceLocation("http://hl7.org/fhir/patient/@1");

            var rln = rl.NavigateTo("@2");
            Assert.AreEqual("patient/@2", rln.OperationPath.ToString());

            rln = rl.NavigateTo("../observation/@3");
            Assert.AreEqual("observation/@3", rln.OperationPath.ToString());
        }
        public void TryNavigation()
        {
            var old = new ResourceLocation("http://www.hl7.org/svc/organization/");
            var rl = old.NavigateTo("../patient/@1/history");

            Assert.AreEqual("www.hl7.org", rl.Host);
            Assert.AreEqual("svc", rl.Service);
            Assert.AreEqual("patient", rl.Collection);
            Assert.AreEqual("1", rl.Id);
            Assert.AreEqual("history", rl.Operation);

            old = new ResourceLocation("http://hl7.org/fhir/patient/@1");
            rl = old.NavigateTo("@2");
            Assert.AreEqual("patient/@2", rl.OperationPath.ToString());

            rl = old.NavigateTo("../observation/@3");
            Assert.AreEqual("observation/@3", rl.OperationPath.ToString());

            old = new ResourceLocation("patient/@1");
            rl = old.NavigateTo("@2");
            Assert.AreEqual("patient/@2", rl.OperationPath.ToString());

            rl = old.NavigateTo("../observation/@3");
            Assert.AreEqual("observation/@3", rl.OperationPath.ToString());
        }