public void OnlyReturnSessionsForTheSpecifiedSpeaker()
        {
            var sessionRepository = Substitute.For<ISessionRepository>();
            var sessionsLoader = new AllSessionsLoader(sessionRepository);

            sessionsLoader.LoadSessions(new UserProfile {UserName = "******"});

            sessionRepository.Received().GetSessionsSubmittedBy("bob");
        }
        public ISessionLoader Create(IConference conference)
        {
            ISessionLoader sessionLoader;

            if (conference.CanPublishAgenda())
            {
                sessionLoader = new SelectedSessionsLoader(sessionRepository);
            }
            else
            {
                sessionLoader = new AllSessionsLoader(sessionRepository);
            }

            return sessionLoader;
        }
Ejemplo n.º 3
0
        public ISessionLoader Create(IConference conference)
        {
            ISessionLoader sessionLoader;

            if (conference.CanPublishAgenda())
            {
                sessionLoader = new SelectedSessionsLoader(sessionRepository, SelectedSessions.SessionIds);
            }
            else
            {
                sessionLoader = new AllSessionsLoader(sessionRepository);
            }

            return(sessionLoader);
        }
 public void ThrowAnException_WhenGivenANullProfile()
 {
     var sessionRepository = Substitute.For<ISessionRepository>();
     var sessionsLoader = new AllSessionsLoader(sessionRepository);
     Assert.Throws<ArgumentNullException>(() => sessionsLoader.LoadSessions(null));
 }