Пример #1
0
        public void EmailCollectionInstanceOK()
        {
            // //create instance of the class
            clsEmailAddressCollection AllEmails = new clsEmailAddressCollection();

            //check to see exists
            Assert.IsNotNull(AllEmails);
        }
Пример #2
0
        void DisplayEmails()
        {
            //create instance of the EmailCollection
            clsEmailAddressCollection Emails = new clsEmailAddressCollection();

            //set the data source to the list of emails in the collection class
            lstBxContacts.DataSource = Emails.AllEmailAddresses;
            //set the data field to display
            lstBxContacts.DisplayMember = "EmailAddress".ToString();
            //set the name of the primary key
            lstBxContacts.ValueMember = "EmailAddressNo";
        }
Пример #3
0
        public void CountEmailAddressMatchesList()
        {
            //create instance of the class
            clsEmailAddressCollection Emails = new clsEmailAddressCollection();
            //create some test data
            List <clsEmail> TestList = new List <clsEmail>();
            //add an item to the list
            clsEmail TestItem = new clsEmail();

            //set the properties
            TestItem.EmailAddressNo = 1;
            TestItem.EmailAddress   = "*****@*****.**";
            //add the item to the test list
            TestList.Add(TestItem);
            //assign the data
            Emails.AllEmailAddresses = TestList;
            //test to see that the two are the same
            Assert.AreEqual(Emails.CountEmailAddresses, TestList.Count);
        }