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); }
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); }
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); }
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); }
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); }