public override bool Equals(object o) { if (o == null) { return(false); } if (o is SiteMembershipCondition) { Site s = new Site((o as SiteMembershipCondition)._site); return(s.Equals(new Site(_site))); } return(false); }
public override bool Equals (object o) { if (o == null) return false; if (o is SiteMembershipCondition) { Site s = new Site ((o as SiteMembershipCondition)._site); return s.Equals (new Site (_site)); } return false; }
public void Site_AllGoMonoSite () { Site s = new Site ("*.go-mono.com"); Assert.AreEqual ("*.go-mono.com", s.Name, "Name"); Assert.AreEqual ("<System.Security.Policy.Site version=\"1\">" + Environment.NewLine + "<Name>*.go-mono.com</Name>" + Environment.NewLine + "</System.Security.Policy.Site>" + Environment.NewLine, s.ToString (), "ToString"); Site s2 = (Site) s.Copy (); Assert.AreEqual (s.Name, s2.Name, "Copy.Name"); Assert.AreEqual (s.GetHashCode (), s2.GetHashCode (), "Copy.GetHashCode"); SiteIdentityPermission sip = (SiteIdentityPermission) s.CreateIdentityPermission (null); Assert.AreEqual (s.Name, sip.Site, "CreateIdentityPermission"); Assert.IsTrue (s.Equals (s2), "Equals"); Site s3 = new Site ("go-mono.com"); Assert.IsTrue (!s.Equals (s3), "!Equals"); }
public void EqualsPartial () { Site s1 = new Site ("www.go-mono.com"); Site s2 = new Site ("*.go-mono.com"); Assert.IsTrue (!s1.Equals (s2), "Partial:1-2"); Assert.IsTrue (!s2.Equals (s1), "Partial:2-1"); }
public void EqualsNull () { Site s1 = new Site ("*.go-mono.com"); Assert.IsTrue (!s1.Equals (null), "EqualsNull"); }
public void EqualsCaseSensitive () { Site s1 = new Site ("*.go-mono.com"); Site s2 = new Site ("*.Go-Mono.com"); Assert.IsTrue (s1.Equals (s2), "CaseSensitive"); }
public void Site_AllGoMonoSite () { Site s = new Site ("*.go-mono.com"); AssertEquals ("Name", "*.go-mono.com", s.Name); #if NET_2_0 AssertEquals ("ToString", "<System.Security.Policy.Site version=\"1\">" + Environment.NewLine + "<Name>*.go-mono.com</Name>" + Environment.NewLine + "</System.Security.Policy.Site>" + Environment.NewLine, s.ToString ()); #else AssertEquals ("ToString", "<System.Security.Policy.Site version=\"1\">" + Environment.NewLine + " <Name>*.go-mono.com</Name>" + Environment.NewLine + "</System.Security.Policy.Site>" + Environment.NewLine, s.ToString ()); #endif Site s2 = (Site) s.Copy (); AssertEquals ("Copy.Name", s.Name, s2.Name); AssertEquals ("Copy.GetHashCode", s.GetHashCode (), s2.GetHashCode ()); SiteIdentityPermission sip = (SiteIdentityPermission) s.CreateIdentityPermission (null); AssertEquals ("CreateIdentityPermission", s.Name, sip.Site); Assert ("Equals", s.Equals (s2)); Site s3 = new Site ("go-mono.com"); Assert ("!Equals", !s.Equals (s3)); }
public void EqualsNull () { Site s1 = new Site ("*.go-mono.com"); Assert ("EqualsNull", !s1.Equals (null)); }
public void EqualsPartial () { Site s1 = new Site ("www.go-mono.com"); Site s2 = new Site ("*.go-mono.com"); Assert ("Partial:1-2", !s1.Equals (s2)); Assert ("Partial:2-1", !s2.Equals (s1)); }
public void EqualsCaseSensitive () { Site s1 = new Site ("*.go-mono.com"); Site s2 = new Site ("*.Go-Mono.com"); Assert ("CaseSensitive", s1.Equals (s2)); }