public void TestThat_AnonymousUserVotes_GetsItsDataFromTheDataProvider()
        {
            var dataProvider = new DataProviderBuilder().Build();
            var controller   = new VotingControllerBuilder().WithDataProvider(dataProvider).Build();

            controller.AnonymousUserVotes();

            dataProvider.Received().GetAnonymousUserVotes();
        }
        public void TestThat_Leaderboard_ForbidsDuplicateSpeakers()
        {
            var dataProvider = new DataProviderBuilder().WithLeaderboard(new[] { new SessionLeaderBoardEntry() }).Build();
            var controller   = new VotingControllerBuilder().WithDataProvider(dataProvider).Build();

            controller.Leaderboard(123, false);

            dataProvider.Received().GetLeaderBoard(Arg.Any <int>(), false);
        }
        public void TestThat_GetSessionsVotedForByKnownUser_ObtainsTheSessionsForTheSpecifiedUser()
        {
            var dataProvider = new DataProviderBuilder().Build();
            var controller   = new VotingControllerBuilder().WithDataProvider(dataProvider).Build();

            controller.GetSessionsVotedForByKnownUser(1234);

            dataProvider.Received().GetVotedForSessions(1234);
        }
        public void TestThat_Leaderboard_LimitsTheNumberOfSessions()
        {
            var dataProvider = new DataProviderBuilder().WithLeaderboard(new[] { new SessionLeaderBoardEntry() }).Build();
            var controller   = new VotingControllerBuilder().WithDataProvider(dataProvider).Build();

            controller.Leaderboard(123);

            dataProvider.Received().GetLeaderBoard(123, Arg.Any <bool>());
        }
        public void TestThat_GetSessionsVotedForByAnonymousUser_ObtainsTheSessionsForTheSpecifiedCookieId()
        {
            var dataProvider = new DataProviderBuilder().Build();
            var controller   = new VotingControllerBuilder().WithDataProvider(dataProvider).Build();
            var cookieId     = Guid.NewGuid();

            controller.GetSessionsVotedForByAnonymousUser(cookieId);

            dataProvider.Received().GetVotedForSessions(cookieId);
        }