public void TestForTarget() { var id = new ResourceIdentity("http://localhost/services/fhir/v012/Patient/3"); Assert.IsTrue(id.IsTargetOf("http://localhost/services/fhir/v012/Patient/3")); Assert.IsTrue(id.IsTargetOf("Patient/3")); id = new ResourceIdentity("http://localhost/services/fhir/v012/Patient/3/_history/50"); Assert.IsTrue(id.IsTargetOf("http://localhost/services/fhir/v012/Patient/3")); Assert.IsTrue(id.IsTargetOf("Patient/3/_history/50")); id = new ResourceIdentity("Patient/3"); Assert.IsFalse(id.IsTargetOf("http://localhost/services/fhir/v012/Patient/3")); Assert.IsTrue(id.IsTargetOf("Patient/3")); id = new ResourceIdentity("urn:oid:1.2.3.4.5.6"); Assert.IsTrue(id.IsTargetOf("urn:oid:1.2.3.4.5.6")); Assert.IsFalse(id.IsTargetOf("1.2.3.4.5.6")); id = new ResourceIdentity("#myid"); Assert.IsTrue(id.IsTargetOf("#myid")); }