public void GetTheLastStudent() { // Arrange: var db = new StudentRegistrationApp.Model.StudentRepository(); // Act: var result = db.LastStudent(); // Assert: Assert.AreEqual(result.Firstname, "Nancy"); }
public void GetStudentByIdNotFound() { var db = new StudentRegistrationApp.Model.StudentRepository(); // Act: var lastResult = db.LastStudent(); long lastId = lastResult.Id + 1; var result = db.GetStudentById(lastId); // Assert: Assert.IsNull(result, "Should not find the id."); }
public void GetLastStudentById() { // Arrange: var db = new StudentRegistrationApp.Model.StudentRepository(); // Act: var lastResult = db.LastStudent(); long lastId = lastResult.Id; var result = db.GetStudentById(lastId); // Assert: Assert.AreEqual(result, lastResult, "Should get the last record"); }