Exemplo n.º 1
0
        //
        // GET: /Phone/Create
        public ActionResult Create()
        {
            IService service = new PhoneService();
            PhoneModel phone = new PhoneModel();

            //Figure out how to create the dropdown list for the page
            //http://blinkingcaret.wordpress.com/2012/08/11/using-html-dropdownlistfor/

            ViewBag.phoneCd = new SelectList(service.getPhoneCds(), "phoneCd", "phoneCodeDescription", phone.phoneCd);
            return View(phone);
        }
Exemplo n.º 2
0
 public void simplePhoneServiceTest()
 {
     PhoneService service = new PhoneService();
     ICollection<PhoneModel> phones = service.listPhonesByUser(1);
     foreach (PhoneModel phone in phones) {
         Assert.AreEqual(1, phone.applicantId);
         if (phone.phoneCd.ToUpper().Equals("HM")){
             Assert.AreEqual(5028011112, phone.phoneNumber);
         }
     }
 }
Exemplo n.º 3
0
 public void simplePhoneServiceTest()
 {
     IPhoneService service = new PhoneService();
     ICollection<PhoneModel> phones = service.listPhonesByUser(1);
     bool hasPhones = false;
     foreach (PhoneModel phone in phones) {
         hasPhones = true;
         Assert.AreEqual(1, phone.applicantId);
         if (phone.phoneCd.ToUpper().Equals("HM")){
             Assert.AreEqual(5028011112, phone.phoneNumber);
         }
     }
     Assert.AreEqual(true, hasPhones, "No Phones were returned from the service call.");
 }
Exemplo n.º 4
0
 //
 // GET: /Phone/Details/5
 public ActionResult Details(int id)
 {
     IService service = new PhoneService();
     return View(service.getPhoneById(id));
 }
Exemplo n.º 5
0
 //
 // GET: /Phone/
 public ActionResult Index()
 {
     IService service = new PhoneService();
     ICollection<PhoneModel> phones = service.listPhones();
     return View(phones);
 }