public void Verify_LedgerService_SqlLedgerRepository_GetLedgerReport_Returns_Empty_Data_Against_InValid_DbStudent()
        {
            ILedgerService ledgerService = new LedgerService(new SqlLedgerRepository());
            var            studentLedger = ledgerService.GetLedgerReport(TestConstants.InvalidUserId);

            Assert.IsNotNull(studentLedger);
            Assert.IsNull(studentLedger.StudentName);
            Assert.IsNotNull(studentLedger.ledgerList);
            Assert.IsTrue(studentLedger.ledgerList.Count == 0);
        }
        public void Verify_SqlLedgerService_GetLedgerReport_Returns_Data_Against_Valid_DbStudent()
        {
            ILedgerService ledgerRepository = new LedgerService();
            var            studentLedger    = ledgerRepository.GetLedgerReport(TestConstants.DbStudentUserId);

            Assert.IsNotNull(studentLedger);
            Assert.IsNotNull(studentLedger.StudentName);
            Assert.IsNotNull(studentLedger.ledgerList);
            Assert.IsTrue(studentLedger.ledgerList.Count > 0);
        }
        public void Verify_LedgerService_TestLedgerRepository_GetLedgerReport_Returns_Data_Against_TestStudent()
        {
            ILedgerService ledgerService = new LedgerService(new TestLedgerRepository());
            var            studentLedger = ledgerService.GetLedgerReport(1);

            Assert.IsNotNull(studentLedger);
            Assert.IsNotNull(studentLedger.StudentName);
            Assert.IsNotNull(studentLedger.ledgerList);
            Assert.IsTrue(studentLedger.ledgerList.Count > 0);
        }
예제 #4
0
        public ActionResult StudentLedger()
        {
            try
            {
                ILedgerService studentLedgerService = new LedgerService();
                var            studentLedger        = studentLedgerService.GetLedgerReport(StudentNo);

                return(View(studentLedger));
            }
            catch (Exception ex)
            {
                //ViewData["ErrorMessage"] = ex.Message;
                Response.Redirect("../User/Result/error");


                return(null);
            }
        }
예제 #5
0
        public ActionResult StudentLedger()
        {
            try
            {
                ILedgerService studentLedgerService = new LedgerService();
                var            studentLedger        = studentLedgerService.GetLedgerReport(StudentNo);

                return(View(studentLedger));
            }
            catch (Exception ex)
            {
                _logger.Error("Exception Occurred. StudentNo: " + StudentNo, ex);

                Response.Redirect(AppHelper.SharedUrl("Reply/Error"));


                return(null);
            }
        }