Esempio n. 1
0
        public static void SetNbVotesBasedOnEmotes(this Idee idee, IReadOnlyDictionary<IEmote, ReactionMetadata> reactions)
        {
            var ideeContext = new BoiteAIdee();

            var reaction = reactions.FirstOrDefault(r => r.Key.Name == ideeContext.EmoteUpVote.Name);

            idee.SetNbVote(reaction.Value.ReactionCount);
        }
Esempio n. 2
0
        public void ShouldUpdateNbVoteMarkAsModified()
        {
            var       idee           = new Idee();
            const int expectedNbVote = 1;

            idee.SetNbVote(expectedNbVote);

            idee.IsModified().Should().BeTrue();
        }
Esempio n. 3
0
        public void ShouldUpdateNbVote()
        {
            var       idee           = new Idee();
            const int expectedNbVote = 1;

            idee.SetNbVote(expectedNbVote);

            idee.NombreVotes.Should().Be(expectedNbVote);
        }
Esempio n. 4
0
        public void ShouldUpdateSameNbVoteNotMarkAsModified()
        {
            const int expectedNbVote = 1;
            var       idee           = new Idee
            {
                NombreVotes = expectedNbVote,
            };

            idee.SetNbVote(expectedNbVote);

            idee.IsModified().Should().BeFalse();
        }