Example #1
0
        public void GetDetailTest()
        {
            StudentDetailRep        res = new StudentDetailRep(db);
            StudentDetailController obj = new StudentDetailController(res);
            var data     = obj.Get1(1);
            var okResult = data as ObjectResult;

            Assert.AreEqual(200, okResult.StatusCode);
        }
Example #2
0
        public void GetDetailsTest()
        {
            var res = new Mock <StudentDetailRep>(db);
            StudentDetailController obj = new StudentDetailController(res.Object);
            var data     = obj.Get();
            var okResult = data as OkObjectResult;

            Assert.AreEqual(200, okResult.StatusCode);
        }
Example #3
0
        public void Delete_Valid_Detail()
        {
            StudentDetailRep        loandata = new StudentDetailRep(db);
            StudentDetailController obj      = new StudentDetailController(loandata);
            var data     = obj.Delete(1);
            var okResult = data as OkObjectResult;

            Assert.AreEqual(200, okResult.StatusCode);
        }
Example #4
0
        public void Update_Valid_Detail()
        {
            StudentDetail emp = new StudentDetail {
                LastName = "Dummy 1", FirstName = "DD", Age = 30
            };
            StudentDetailRep        res = new StudentDetailRep(db);
            StudentDetailController obj = new StudentDetailController(res);
            var data     = obj.Put(1, emp);
            var okResult = data as OkObjectResult;

            Assert.AreEqual(200, okResult.StatusCode);
        }
Example #5
0
        public void Add_Valid_Detail()
        {
            var res = new Mock <StudentDetailRep>(db);
            StudentDetailController obj = new StudentDetailController(res.Object);
            StudentDetail           emp = new StudentDetail {
                StudentId = 4, LastName = "Dummy 1", FirstName = "DD", Age = 34
            };

            var data     = obj.Post(emp);
            var okResult = data as OkObjectResult;

            Assert.AreEqual(200, okResult.StatusCode);
        }