예제 #1
0
        public void TestEquality()
        {
            var list1 = new InternetAddressList();

            list1.Add(new GroupAddress("Local recipients", new InternetAddress[] {
                new MailboxAddress("", "phil"),
                new MailboxAddress("", "joe"),
                new MailboxAddress("", "alex"),
                new MailboxAddress("", "bob"),
            }));
            list1.Add(new MailboxAddress("Joey", "*****@*****.**"));
            list1.Add(new MailboxAddress("Chandler", "*****@*****.**"));

            var list2 = new InternetAddressList();

            list2.Add(new MailboxAddress("Chandler", "*****@*****.**"));
            list2.Add(new GroupAddress("Local recipients", new InternetAddress[] {
                new MailboxAddress("", "phil"),
                new MailboxAddress("", "joe"),
                new MailboxAddress("", "alex"),
                new MailboxAddress("", "bob"),
            }));
            list2.Add(new MailboxAddress("Joey", "*****@*****.**"));

            Assert.IsFalse(list1.Equals(null), "Equals null");
            Assert.IsFalse(list1.Equals(new InternetAddressList()), "Equals empty list");
            Assert.IsTrue(list1.Equals(list2), "The 2 lists should be equal.");
        }
		public void TestEquality ()
		{
			var list1 = new InternetAddressList ();

			list1.Add (new GroupAddress ("Local recipients", new InternetAddress[] {
				new MailboxAddress ("", "phil"),
				new MailboxAddress ("", "joe"),
				new MailboxAddress ("", "alex"),
				new MailboxAddress ("", "bob"),
			}));
			list1.Add (new MailboxAddress ("Joey", "*****@*****.**"));
			list1.Add (new MailboxAddress ("Chandler", "*****@*****.**"));

			var list2 = new InternetAddressList ();

			list2.Add (new MailboxAddress ("Chandler", "*****@*****.**"));
			list2.Add (new GroupAddress ("Local recipients", new InternetAddress[] {
				new MailboxAddress ("", "phil"),
				new MailboxAddress ("", "joe"),
				new MailboxAddress ("", "alex"),
				new MailboxAddress ("", "bob"),
			}));
			list2.Add (new MailboxAddress ("Joey", "*****@*****.**"));

			Assert.IsTrue (list1.Equals (list2), "The 2 lists should be equal.");
		}