Beispiel #1
0
 public ActionResult Edit(IncidentTypeData incidentType)
 {
     if (ModelState.IsValid)
     {
         _access.Update(incidentType);
         return(RedirectToAction("Index"));
     }
     return(View(incidentType));
 }
        public void Effort_IncidentTypes_Update_Test()
        {
            int _id = _incidentTypeId;
            IncidentTypeData _row = _sut.GetByPrimaryKey(_id);

            _row.IncidentTypeDesc = "123456789 123456789";
            int _rowCnt = _sut.Update(_row.IncidentTypeId, _row.IncidentTypeShortDesc, _row.IncidentTypeDesc, _row.IncidentTypeFromServer, _row.IncidentTypeSubjectLine, _row.IncidentTypeEmailTemplate, _row.IncidentTypeTimeTemplate, _row.IncidentTypeThanksTemplate, _row.IncidentTypeLogTemplate, _row.IncidentTypeTemplate);

            Assert.AreEqual(_rowCnt, 1);
            IncidentTypeData _new = _sut.GetByPrimaryKey(_id);

            System.Diagnostics.Debug.WriteLine(_new.ToString());
            Assert.AreEqual(_row.IncidentTypeId, _new.IncidentTypeId);
            Assert.AreEqual(_row.IncidentTypeDesc, _new.IncidentTypeDesc);
        }