Exemplo n.º 1
0
        public void TestEquals()
        {
            MyDelegate dela = new MyDelegate(MethodA);
            MyDelegate delb = new MyDelegate(MethodB);
            MyDelegate delc = new MyDelegate(MethodC);

            Assert.AreEqual(false, dela == delb, "#A01");

            MyDelegate del1, del2;

            del1 = dela + delb;
            del2 = delb + delc;
            Assert.AreEqual(false, del1 == del2, "#A02");

            del1 += delc;
            del2  = dela + del2;
            Assert.AreEqual(true, del1 == del2, "#A03");

            object o = new object();

            Assert.AreEqual(false, dela.Equals(o), "#A04");
        }
	public void TestEquals()
	{
		MyDelegate dela = new MyDelegate( MethodA );
		MyDelegate delb = new MyDelegate( MethodB );
		MyDelegate delc = new MyDelegate( MethodC );

		Assert.AreEqual(false, dela == delb , "#A01");
		
		MyDelegate del1, del2;

		del1 = dela + delb;
		del2 = delb + delc;
		Assert.AreEqual(false, del1 == del2 , "#A02");
		
		del1 += delc;
		del2 = dela + del2;
		Assert.AreEqual(true, del1 == del2 , "#A03");
		
		object o = new object ();
		
		Assert.AreEqual (false, dela.Equals (o), "#A04");
		
	}
	public void TestEquals()
	{
		MyDelegate dela = new MyDelegate( MethodA );
		MyDelegate delb = new MyDelegate( MethodB );
		MyDelegate delc = new MyDelegate( MethodC );

		AssertEquals( "#A01", false, dela == delb );
		
		MyDelegate del1, del2;

		del1 = dela + delb;
		del2 = delb + delc;
		AssertEquals( "#A02", false, del1 == del2 );
		
		del1 += delc;
		del2 = dela + del2;
		AssertEquals( "#A03", true, del1 == del2 );
		
		object o = new object ();
		
		AssertEquals ("#A04", false, dela.Equals (o));
		
	}
Exemplo n.º 4
0
 public void TestEqualsMyDelegate()
 {
     Assert.IsTrue(!myDelegateInt.Equals(myDelegateVoid));
 }