コード例 #1
0
        public void End_AssesmentDoneStatusRemains_StatusDoesNotChange()
        {
            Assesment a = new Assesment(DEFAULT_ID);

            if (a.GetInfo().Status == AssesmentStatus.Done)
            {
                a.End();
                Assert.AreEqual(AssesmentStatus.Done, a.GetInfo().Status);
            }
            else
            {
                Assert.IsTrue(true);
            }
        }
コード例 #2
0
        public void GetByID_AssesmentNotFound_ObjectIsNull()
        {
            Assesment   a  = new Assesment(0);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(null, to);
        }
コード例 #3
0
        public void GetByID_AssesmentFound_IdIsValid()
        {
            Assesment   a  = new Assesment(DEFAULT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(true, !String.IsNullOrEmpty(to.Evaluation.Name));
        }
コード例 #4
0
        public void GetByAssesmentID_AssesmentFound_EvaluationHasName()
        {
            Assesment   a  = new Assesment(DEFAULT_ASSESMENT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(true, !String.IsNullOrEmpty(to.Evaluation.Name));
        }
コード例 #5
0
        public void GetByAssesmentID_AssesmentFound_DefaultIdIsRight()
        {
            Assesment   a  = new Assesment(DEFAULT_ASSESMENT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.AreEqual(1, to.ID);
        }
コード例 #6
0
        public void GetByAssesmentID_AssesmentDoesNotExist_ElementIsNull()
        {
            Assesment   a  = new Assesment("xxx");
            AssesmentTO to = a.GetInfo();

            Assert.IsNull(to);
        }
コード例 #7
0
        public void GetByAssesmentID_AssesmentFound_ElementIsNotNull()
        {
            Assesment   a  = new Assesment(DEFAULT_ASSESMENT_ID);
            AssesmentTO to = a.GetInfo();

            Assert.IsNotNull(to);
        }
コード例 #8
0
        public ActionResult GetData()
        {
            Assesment assesment = Session[SESSION_ASSESMENT_OBJECT] != null ? (Assesment)Session[SESSION_ASSESMENT_OBJECT] : null;

            if (assesment == null)
            {
                return(Json(new { }, JsonRequestBehavior.AllowGet));
            }

            return(Json(assesment.GetInfo(), JsonRequestBehavior.AllowGet));
        }
コード例 #9
0
        public ActionResult CheckAndRoute()
        {
            Assesment assesment = Session[SESSION_ASSESMENT_OBJECT] != null ? (Assesment)Session[SESSION_ASSESMENT_OBJECT] : null;

            if (assesment != null)
            {
                if (assesment.GetInfo().Status == AssesmentStatus.Done)
                {
                    return(View("AlreadyDone"));
                }
                else
                {
                    if (assesment.GetInfo().Status == AssesmentStatus.Started)
                    {
                        return(View("Execution"));
                    }
                }
            }

            return(View());
        }
コード例 #10
0
        public ActionResult Employee(int id)
        {
            if (Session[SessionConstants.Company] == null)
            {
                return(View(LoginPage));
            }

            ViewBag.Employee = model.GetEmployee(id, GetSessionCompany().CompanyId);

            Assesment assesment = model.GetEmployeeAssesment(id, GetSessionCompany().CompanyId);

            if (assesment != null)
            {
                ViewBag.Assesment = assesment.GetInfo();
                if (assesment.GetInfo().Status == AssesmentStatus.Done)
                {
                    ViewBag.AssesmentReport = assesment.GetReport();
                }
            }

            return(View(GetSessionCompany()));
        }
コード例 #11
0
        public ActionResult GetData()
        {
            Assesment assesment = Session[SESSION_ASSESMENT_OBJECT] != null ? (Assesment)Session[SESSION_ASSESMENT_OBJECT] : null;

            if (assesment == null)
            {
                return(Json(new { }, JsonRequestBehavior.AllowGet));
            }

            AssesmentTO obj = assesment.GetInfo();
            IEnumerable <SectionDTO> list =
                from s in obj.Evaluation.Sections
                select new SectionDTO()
            {
                SectionId         = s.SectionId,
                Name              = s.Name,
                Description       = s.Description,
                EstimatedDuration = s.EstimatedDuration,
                Type              = s.Type
            };

            return(Json(new { obj = new { Evaluation = new { Name = obj.Evaluation.Name, Description = obj.Evaluation.Description }, Company = obj.Company }, Sections = list }, JsonRequestBehavior.AllowGet));
        }