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); }
public void ShouldUpdateNbVoteMarkAsModified() { var idee = new Idee(); const int expectedNbVote = 1; idee.SetNbVote(expectedNbVote); idee.IsModified().Should().BeTrue(); }
public void ShouldUpdateNbVote() { var idee = new Idee(); const int expectedNbVote = 1; idee.SetNbVote(expectedNbVote); idee.NombreVotes.Should().Be(expectedNbVote); }
public void ShouldUpdateSameNbVoteNotMarkAsModified() { const int expectedNbVote = 1; var idee = new Idee { NombreVotes = expectedNbVote, }; idee.SetNbVote(expectedNbVote); idee.IsModified().Should().BeFalse(); }