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);
        }
Пример #2
0
        public HobbyController()
        {
            _hm = new HobbyManagement();

            _hr = new HobbyRepository();
        }
Пример #3
0
 public HobbysService(HobbyRepository hr)
 {
     _hr = hr;
 }