public void TestCreateShouldReturnNewId() { ProblemDAO dao = new ProblemDAO(); Problem prob = new Problem(); prob.Description = "Testing"; prob.Version = 1; Assert.IsTrue(dao.Create(prob).GetIdAsString().Length == 24); }
public void Create() { try { Problem prob = new Problem(); prob.Description = Description; Id = _dao.Create(prob); } catch (Exception ex) { ErrorRoutine(ex, "ProblemViewModel", "Create"); } }
public void Create() { try { Problem prob = new Problem(); prob.Description = Description; prob.Version = Version; ProblemId = _dao.Create(prob).GetIdAsString(); } catch (Exception ex) { ViewModelUtils.ErrorRoutine(ex, "ProblemViewModel", "Create"); } }
public void ProblemDAOCreateAndDeleteShouldReturnTrue() { bool deleteOk = false; Problem prob = new Problem(); ProblemDAO dao = new ProblemDAO(); prob.Description = "Spilt Mountain Dew Code red all over"; string newid = dao.Create(prob); if (newid.Length == 24) // new id's are a 24 byte hex string { deleteOk = dao.Delete(newid); } Assert.IsTrue(deleteOk); }
public void TestCreateShouldReturnNewId() { if (did_create_test_run) { return; } Problem p = new Problem(); ProblemDAO dao = new ProblemDAO(); p.Description = description; p.Version = 1; Assert.IsTrue(dao.Create(p).GetIdAsString().Length == 24); id_string = p.GetIdAsString(); did_create_test_run = true; }// TestCreateShouldReturnNewId