Пример #1
0
        public void TestDeleteShouldReturnOne()
        {
            ProblemDAO dao  = new ProblemDAO();
            Problem    prob = dao.GetByProblemDescription("Testing");

            if (prob == null)
            {
                TestCreateShouldReturnNewId();
                prob = dao.GetByProblemDescription("Testing");
            }
            Assert.IsTrue(dao.Delete(prob.GetIdAsString()) == 1);
        }
Пример #2
0
    public void TestDeleteShouldReturnOne()
    {
        if (!did_create_test_run)
        {
            TestCreateShouldReturnNewId();
        }

        ProblemDAO dao = new ProblemDAO();
        Problem    p   = dao.GetById(id_string);

        Assert.IsTrue(dao.Delete(p.GetIdAsString()) == 1);
    } // TestShouldReturnOne
Пример #3
0
        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);
        }
Пример #4
0
        public long Delete()
        {
            long deleted = 0;

            try
            {
                deleted = _dao.Delete(ProblemId);
                return(deleted);
            }
            catch (Exception ex)
            {
                ViewModelUtils.ErrorRoutine(ex, "ProblemViewModel", "Delete()");
                return(deleted);
            }
        }
Пример #5
0
        /*
         *  Delete()
         *  ViewModel Layer of delete, calls the ProblemDAO's delete method based on the id passed from the controller
         */
        public long Delete()
        {
            long delStatus = 0;

            try
            {
                delStatus = _dao.Delete(Id);
            }
            catch (Exception ex)
            {
                ViewModelUtils.ErrorRoutine(ex, "ProblemViewModel", "Delete");
            }

            return(delStatus);
        }
Пример #6
0
        public bool Delete()
        {
            bool deleteOk = false;

            try
            {
                deleteOk = _dao.Delete(Id);
            }
            catch (Exception ex)
            {
                ErrorRoutine(ex, "ProblemViewModel", "Delete");
            }

            return(deleteOk);
        }