Exemplo n.º 1
0
 private void loadContactTypes()
 {
     using (var context = new Entities())
     {
         // contact type is an ambiguous name
         var ContactTypes = new Repository.PersonRepository.ContactType(context);
         var contactTypes = ContactTypes.contactTypes().ToList();
         this.personContactTypes.DataSource = contactTypes;
     }
     this.personContactTypes.DisplayMember = "Name";
     this.personContactTypes.ValueMember   = "ContactTypeID";
 }
Exemplo n.º 2
0
        public void getIEnumberableOfContactType()
        {
            var context = new Entities();

            Repository.PersonRepository.ContactType contactType = new Repository.PersonRepository.ContactType(context);
            var items = contactType.contactTypes().ToList();

            //returns IEnumberable<AdventureWorks.Model.ContactType> and validate value in model.
            foreach (var item in items)
            {
                if (!item.Equals("Accounting Manager"))
                {
                    continue;
                }
                Assert.AreEqual("Accounting Manager", item.Name);
            }
        }