public void Add_Valid_Detail() { Admin admindata = new Admin(db); AdminController obj = new AdminController(admindata); BasicDetails dummydata = new BasicDetails() { Name = "Dummy5", Gender = "Female", Address = "Dummy Address 5", DateOfBirth = DateTime.Parse("11/23/2010"), Phone = "1122334400", Email = "*****@*****.**", Course = "course1", CourseDuration = 4, FeeStatus = "Paid" }; var data = obj.AddDetail(dummydata); var okResult = data as OkObjectResult; Assert.AreEqual(200, okResult.StatusCode); }