public void FilterOutUsersWhoHaveNotSubmittedSessions()
        {
            var sessionRepository = Substitute.For<ISessionRepository>();
            var profileFilter = new SubmittedSessionProfileFilter(sessionRepository);

            var profile1 = new UserProfile {UserName = "******"};
            var profile2 = new UserProfile {UserName = "******"};
            var profile3 = new UserProfile {UserName = "******"};
            sessionRepository.GetSessionsSubmittedBy("bob").Returns(new[] {new Session {SpeakerUserName = "******"}});

            var profiles = profileFilter.FilterProfiles(new[] {profile1, profile2, profile3});

            CollectionAssert.AreEquivalent(new[] {profile3}, profiles);
        }
Ejemplo n.º 2
0
        public IUserProfileFilter Create(IConference conference)
        {
            IUserProfileFilter userProfileFilter;

            if (conference.CanPublishAgenda())
            {
                userProfileFilter = new SelectedSpeakerProfileFilter(SelectedSessions.SpeakerIds);
            }
            else
            {
                userProfileFilter = new SubmittedSessionProfileFilter(sessionRepository);
            }

            return(userProfileFilter);
        }
        public IUserProfileFilter Create(IConference conference)
        {
            IUserProfileFilter userProfileFilter;

            if (conference.CanPublishAgenda())
            {
                userProfileFilter = new SelectedSpeakerProfileFilter();
            }
            else
            {
                userProfileFilter = new SubmittedSessionProfileFilter(sessionRepository);
            }

            return userProfileFilter;
        }