/* * GetById() * ViewModel Layer of GetById, calls the ProblemDAO's GetByProblemId method * Uses the passed Id and calls the related method in the DAO based on the id */ public void GetById() { try { Problem prob = _dao.GetByProblemId(Id); Id = prob.GetIdAsString(); Description = prob.Description; Version = prob.Version; } catch (Exception ex) { ViewModelUtils.ErrorRoutine(ex, "ProblemViewModel", "GetById"); } }
public void TestGetByProblemIdShouldReturnProblem() { ProblemDAO dao = new ProblemDAO(); Assert.IsInstanceOfType(dao.GetByProblemId(pid), typeof(Problem)); }