コード例 #1
0
        public void RegisteredShadowVoteUnregistersAutomaticallyWhenEntryVoteCountIsReset()
        {
            var  accessControl = SetupVotableAccessControl();
            Guid token         = accessControl.RegisterRemoteAccessToken(new Guid());

            PlaylistEntry entry = SetupShadowVotedEntry();

            accessControl.RegisterShadowVote(token, entry);

            entry.ResetVotes();

            Assert.False(entry.IsShadowVoted);
        }
コード例 #2
0
        public void RegisteredVoteUnregistersAutomaticallyWhenEntryVoteCountIsReset()
        {
            var accessControl = SetupVotableAccessControl(2);
            Guid token = accessControl.RegisterRemoteAccessToken(new Guid());

            var entry = new PlaylistEntry(0, Helpers.SetupSongMock());
            entry.Vote();

            var votes = accessControl.ObserveRemainingVotes(token).CreateCollection();
            accessControl.RegisterVote(token, entry);

            entry.ResetVotes();

            Assert.Equal(new int?[] { 2, 1, 2 }, votes);
        }
コード例 #3
0
        public void RegisteredVoteUnregistersAutomaticallyWhenEntryVoteCountIsReset()
        {
            var  accessControl = SetupVotableAccessControl(2);
            Guid token         = accessControl.RegisterRemoteAccessToken(new Guid());

            var entry = new PlaylistEntry(0, Helpers.SetupSongMock());

            entry.Vote();

            var votes = accessControl.ObserveRemainingVotes(token).CreateCollection();

            accessControl.RegisterVote(token, entry);

            entry.ResetVotes();

            Assert.Equal(new int?[] { 2, 1, 2 }, votes);
        }