public void ResourceIdentityComparing() { ResourceIdentity a, b; //Voor de werking van de tests zelf. a = new ResourceIdentity("Patient/1"); b = new ResourceIdentity("Patient/1"); Assert.IsTrue(a.SameAs(b)); a = new ResourceIdentity("Patient/1"); b = new ResourceIdentity("Patient/2"); Assert.IsFalse(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/1"); Assert.IsTrue(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/2"); Assert.IsFalse(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/1/_history/2"); Assert.IsFalse(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/2/_history/1"); Assert.IsFalse(a.SameAs(b)); }
public void ResourceIdentityComparing() { ResourceIdentity a, b; // Testing the testing method a = new ResourceIdentity("Patient/1"); b = new ResourceIdentity("Patient/1"); Assert.IsTrue(a.SameAs(b)); a = new ResourceIdentity("Patient/1"); b = new ResourceIdentity("Patient/2"); Assert.IsFalse(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/1"); Assert.IsTrue(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/2"); Assert.IsFalse(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/1/_history/2"); Assert.IsFalse(a.SameAs(b)); a = new ResourceIdentity("Patient/1/_history/1"); b = new ResourceIdentity("Patient/2/_history/1"); Assert.IsFalse(a.SameAs(b)); }
public static bool Has(this SearchResults list, Uri uri) { foreach (Uri item in list) { //if (item.ToString() == uri.ToString()) ResourceIdentity a = new ResourceIdentity(item); ResourceIdentity b = new ResourceIdentity(uri); if (a.SameAs(b)) { return(true); } } return(false); }