public async void Repository_AddStudent() { //Arrange ServiceResponse <Student> serviceResponse = new ServiceResponse <Student> { Data = new Student { StudentId = 7, StudentName = "Test", Class = 7, Subject = "Test", Marks = 77 } }; //Act A.CallTo(() => _studentDataRepository.addStudentDetails(A <Student> .Ignored)).Returns(serviceResponse); ServiceResponse <Student> StudentDetails = await _studentData.addStudentDetails(serviceResponse.Data); //Assert Assert.Equal(StudentDetails, serviceResponse); }
public async Task <ServiceResponse <Student> > addStudentDetails(Student student) { return(await _studentDataRepository.addStudentDetails(student)); }