public void testList020()
        {
            EmailList el = new EmailList();

            // Using the generic "Wrap" API so that we can use this
            // test against any internationalized version of the ADK
            Email email1 = new Email(EmailType.Wrap("foo"), "*****@*****.**");
            Email email2 = new Email(EmailType.Wrap("foo"), "*****@*****.**");

            el.Add(email1);
            el.Add(email2);

            Assert.IsNotNull(email1.Parent, "Parent should not be null");
            Assert.IsNotNull(email2.Parent, "Parent should not be null");

            el.Clear();
            Assert.AreEqual(0, el.ChildCount, "Should have 0 emails");
            Assert.IsNull(email1.Parent, "Parent should be null");
            Assert.IsNull(email2.Parent, "Parent should be null");
        }
        public void testList020()
        {
            EmailList el = new EmailList();

            // Using the generic "Wrap" API so that we can use this
            // test against any internationalized version of the ADK
            Email email1 = new Email(EmailType.Wrap("foo"), "*****@*****.**");
            Email email2 = new Email(EmailType.Wrap("foo"), "*****@*****.**");


            el.Add(email1);
            el.Add(email2);

            Assert.IsNotNull(email1.Parent, "Parent should not be null");
            Assert.IsNotNull(email2.Parent, "Parent should not be null");

            el.Clear();
            Assert.AreEqual(0, el.ChildCount, "Should have 0 emails");
            Assert.IsNull(email1.Parent, "Parent should be null");
            Assert.IsNull(email2.Parent, "Parent should be null");
        }
Exemple #3
0
        public void testSetEmails()
        {
            StudentPersonal sp     = ObjectCreator.CreateStudentPersonal();
            Email           email1 = new Email(EmailType.PRIMARY, "*****@*****.**");
            Email           email2 = new Email(EmailType.ALT1, "*****@*****.**");

            EmailList eList = new EmailList();

            eList.AddRange(email1, email2);
            sp.EmailList = eList;


            EmailList studentEmails = sp.EmailList;

            Assert.AreEqual(2, studentEmails.Count, "Should be two emails");

            studentEmails.Clear();
            Assert.AreEqual(0, studentEmails.Count, "Should be zero emails after clearing");

            sp.EmailList  = new EmailList();
            studentEmails = sp.EmailList;
            Assert.AreEqual(0, studentEmails.Count, "Should be zero emails after setting empty list");
        }
 private void ExecuteClearCommand()
 {
     EmailList.Clear();
 }