Equals() public method

public Equals ( object o ) : bool
o object
return bool
Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
		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;
		}
Exemplo n.º 3
0
		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");
		}
Exemplo n.º 4
0
		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");
		}
Exemplo n.º 5
0
		public void EqualsNull () 
		{
			Site s1 = new Site ("*.go-mono.com");
			Assert.IsTrue (!s1.Equals (null), "EqualsNull");
		}
Exemplo n.º 6
0
		public void EqualsCaseSensitive () {
			Site s1 = new Site ("*.go-mono.com");
			Site s2 = new Site ("*.Go-Mono.com");
			Assert.IsTrue (s1.Equals (s2), "CaseSensitive");
		}
Exemplo n.º 7
0
		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));
		}
Exemplo n.º 8
0
		public void EqualsNull () 
		{
			Site s1 = new Site ("*.go-mono.com");
			Assert ("EqualsNull", !s1.Equals (null));
		}
Exemplo n.º 9
0
		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));
		}
Exemplo n.º 10
0
		public void EqualsCaseSensitive () {
			Site s1 = new Site ("*.go-mono.com");
			Site s2 = new Site ("*.Go-Mono.com");
			Assert ("CaseSensitive", s1.Equals (s2));
		}