public async void GetHobbyTest() { IList <Hobby> hobbies = GenerateHobbies(); var FriendFinderContextMock = new Mock <FriendFinderContext>(); FriendFinderContextMock.Setup(h => h.Hobbies).ReturnsDbSet(hobbies); var logger = Mock.Of <ILogger <HobbyRepository> >(); var hobbyRepository = new HobbyRepository(FriendFinderContextMock.Object, logger); //Act var result = await hobbyRepository.GetHobby(2); //Assert Assert.Equal(2, result.HobbyId); }
public HobbyController() { _hm = new HobbyManagement(); _hr = new HobbyRepository(); }
public HobbysService(HobbyRepository hr) { _hr = hr; }