public void ShouldSetEtatRejeteeMarkAsModified() { var idee = new Idee(); idee.SetEtatRejetee(); idee.IsModified().Should().BeTrue(); }
public void ShouldSetEtatEnCoursMarkAsModified() { var idee = new Idee(); idee.SetEtatEnCours(); idee.IsModified().Should().BeTrue(); }
public void ShouldUpdateNbVoteMarkAsModified() { var idee = new Idee(); const int expectedNbVote = 1; idee.SetNbVote(expectedNbVote); idee.IsModified().Should().BeTrue(); }
public void ShouldSetSameEtatNotMarkAsModified() { var idee = new Idee { EtatIdee = EtatsIdees.EnCours, }; idee.SetEtatEnCours(); idee.IsModified().Should().BeFalse(); }
public void ShouldUpdateSameNbVoteNotMarkAsModified() { const int expectedNbVote = 1; var idee = new Idee { NombreVotes = expectedNbVote, }; idee.SetNbVote(expectedNbVote); idee.IsModified().Should().BeFalse(); }
private static async Task UpdateDiscordMessage(Idee idee, IMessage msgIdee) { if (idee.IsArchived && msgIdee is IUserMessage msgToDelete) { await msgToDelete.DeleteAsync(); idee.ClearIdMsgDiscord(); } else if (idee.IsModified() && msgIdee is IUserMessage msgToUpdate) { await msgToUpdate.ModifyAsync(m => { m.Embed = idee.GetBuilder().Build(); }); } }