public void TestCreateShouldReturnNewId() { Department dep = new Department(); DepartmentDAO dao = new DepartmentDAO(); dep.DepartmentName = "Test Department"; dep.Version = 1; Assert.IsTrue(dao.Create(dep).GetIdAsString().Length == 24); }// TestCreateShouldReturnNewId
public void TestCreateShouldReturnNewId() { DepartmentDAO dao = new DepartmentDAO(); Department dep = new Department(); dep.DepartmentName = "Medical"; dep.Version = 1; // 12 byte hex = 24 byte string Assert.IsTrue(dao.Create(dep).GetIdAsString().Length == 24); }
public void Create() { try { Department dep = new Department(); dep.DepartmentName = DepartmentName; Id = _dao.Create(dep); } catch (Exception ex) { ErrorRoutine(ex, "DepartmentViewModel", "Create"); } }
public void Create() { try { Department dept = new Department(); dept.DepartmentName = DepartmentName; dept.Version = 1; Id = _dao.Create(dept).GetIdAsString(); } catch (Exception ex) { ViewModelUtils.ErrorRoutine(ex, "DepartmentViewModel", "GetById"); } }
public void Create() { try { Department dep = new Department(); dep.DepartmentName = Name; dep.Version = Version; dep = _dao.Create(dep); Id = dep.GetIdAsString(); } catch (Exception ex) { ViewModelUtils.ErrorRoutine(ex, "DepartmentViewModel", "Create"); } }
public void Create() { try { Department dept = new Department(); dept.DepartmentName = DepartmentName; dept.Version = Version; dept.SetManagerIdFromString(ManagerId); Id = _dao.Create(dept).GetIdAsString(); } catch (Exception ex) { ViewModelUtils.ErrorRoutine(ex, "DepartmentViewModel", "Create"); } }
public void DepartmentDAOCreateAndDeleteShouldReturnTrue() { bool deleteOk = false; Department dep = new Department(); DepartmentDAO dao = new DepartmentDAO(); dep.DepartmentName = "Human Resources"; // and some hardcoded data string newid = dao.Create(dep); if (newid.Length == 24) // new id's are a 24 byte hex string { deleteOk = dao.Delete(newid); } Assert.IsTrue(deleteOk); }