Beispiel #1
0
        public void TestGetUsersByInterestName()
        {
            var interest = new Interest {
                Name = "skijanje"
            };
            var user = new User {
                Username = "******", Password = "******", PhoneNumber = "098"
            };

            user.AddInterest(interest);
            _interestRepo.Save(interest);

            var interestUsers = _interestRepo.GetUsersByInterestName(interest.Name);

            Assert.IsTrue(interestUsers.Count == 1);

            var user2 = new User {
                Username = "******", Password = "******", PhoneNumber = "099"
            };

            user2.AddInterest(interest);
            _interestRepo.Save(interest);

            interestUsers = _interestRepo.GetUsersByInterestName(interest.Name);
            Assert.IsTrue(interestUsers.Count == 2);
        }
Beispiel #2
0
 public ISet <User> GetInterestUsers(string interestName)
 {
     return(_interestRepository.GetUsersByInterestName(interestName));
 }