public void Sprint_Service_Get_Method_should_return_sprintBacklog_type_object() { //Arrange List <Sprint> requests = new List <Sprint>(); var request = new Sprint(); request.SprintId = 1; requests.Add(request); var mockRepoReq = new Mock <ISprintRepository>(); //mocking RequestRepository mockRepoReq.Setup(x => x.GetAll(1)).Returns(requests); //mocking GetAll() of RequestRepository SprintService obj = new SprintService(mockRepoReq.Object); //Act var res = obj.GetAll(1); //Assert Assert.Equal(res, requests); }