Exemple #1
0
        public void UserShouldBeOffline()
        {
            // setup
            const int USER_ID = 1;

            // tear down
            _monitorTask.IsOnline(USER_ID).Should().Be(false);
        }
Exemple #2
0
        private IEnumerable <UserFound> SearchByCondition(IEnumerable <string> searchWords,
                                                          Expression <Func <UserModel, bool> > predicate,
                                                          Func <IEnumerable <string>, UserModel, int> getRelevance, IUnitOfWork unitOfWork)
        {
            IEnumerable <UserFound> found = unitOfWork.Users.Filter(predicate).ToList().Select(model => new UserFound
            {
                Id         = model.Id,
                Department = model.Department,
                IsOnline   = usersMonitorTask.IsOnline(model.Id),
                Name       = model.FirstName + " " + model.LastName,
                Relevance  = getRelevance(searchWords, model)
            });

            return(found);
        }