public void GetById() { // Arrange StudentsEntities context = new StudentsEntities(); var repository = new StudentsRepository(context); // Act Student result = repository.Get(3); // Assert Student expectedStudent = new Student() { firstName = "pesho", lastName = "peshev", age = 20, grade = 5 }; Assert.AreEqual(expectedStudent.firstName, result.firstName); Assert.AreEqual(expectedStudent.lastName, result.lastName); Assert.AreEqual(expectedStudent.age, result.age); Assert.AreEqual(expectedStudent.grade, result.grade); }
public SchoolsController() { dbContext = new StudentsEntities(); this.repository = new SchoolsRepository(dbContext); }
public MarksController() { dbContext = new StudentsEntities(); this.repository = new MarksRepository(dbContext); }