public async Task UnlikeMeetingComment_WhenDataIsValid_IsSuccessful() { // Arrange await MeetingsModule.ExecuteCommandAsync( new CreateMemberCommand( Guid.NewGuid(), ExecutionContext.UserId, "ivan_petrov", "*****@*****.**", "Ivan", "Petrov", "Ivan Petrov")); var meetingId = await MeetingHelper.CreateMeetingAsync(MeetingsModule, ExecutionContext); var meetingCommentId = await MeetingsModule.ExecuteCommandAsync(new AddMeetingCommentCommand(meetingId, "The meeting was awesome.")); await MeetingsModule.ExecuteCommandAsync(new AddMeetingCommentLikeCommand(meetingCommentId)); await AssertEventually( new GetMeetingCommentsProbe(MeetingsModule, meetingId, meetingCommentId, expectedCommentLikesCount : 1), 10000); // Act await MeetingsModule.ExecuteCommandAsync(new RemoveMeetingCommentLikeCommand(meetingCommentId)); // Assert var meetingCommentLikers = await MeetingsModule.ExecuteQueryAsync(new GetMeetingCommentLikersQuery(meetingCommentId)); Assert.That(meetingCommentLikers.Count, Is.EqualTo(0)); await AssertEventually( new GetMeetingCommentsProbe(MeetingsModule, meetingId, meetingCommentId, expectedCommentLikesCount : 0), 10000); }
public async Task AddReply_WhenDataIsValid_IsSuccessful() { // Arrange var meetingId = await MeetingHelper.CreateMeetingAsync(MeetingsModule, ExecutionContext); var meetingCommentId = await MeetingsModule.ExecuteCommandAsync(new AddMeetingCommentCommand(meetingId, "The meeting was great.")); var date = new DateTime(2020, 1, 1, 01, 00, 00); SystemClock.Set(date); var reply = "Absolutely!"; // Act var replyId = await MeetingsModule.ExecuteCommandAsync(new AddReplyToMeetingCommentCommand(meetingCommentId, reply)); // Assert var meetingComments = await MeetingsModule.ExecuteQueryAsync(new GetMeetingCommentsQuery(meetingId)); Assert.That(meetingComments.Count, Is.EqualTo(2)); var commentReply = meetingComments.Single(c => c.Id == replyId); Assert.That(commentReply.InReplyToCommentId, Is.EqualTo(meetingCommentId)); Assert.That(commentReply.Comment, Is.EqualTo(reply)); Assert.That(commentReply.AuthorId, Is.EqualTo(ExecutionContext.UserId)); Assert.That(commentReply.CreateDate, Is.EqualTo(date)); Assert.That(commentReply.EditDate, Is.Null); }
public async Task AddMeetingComment_WhenDataIsValid_IsSuccessful() { // Arrange var meetingId = await MeetingHelper.CreateMeetingAsync(MeetingsModule, ExecutionContext); var date = new DateTime(2020, 1, 1, 01, 00, 00); SystemClock.Set(date); var comment = "The meeting was great."; // Act var meetingCommentId = await MeetingsModule.ExecuteCommandAsync(new AddMeetingCommentCommand(meetingId, comment)); // Assert var meetingComments = await MeetingsModule.ExecuteQueryAsync(new GetMeetingCommentsQuery(meetingId)); Assert.That(meetingComments.Count, Is.EqualTo(1)); var meetingComment = meetingComments.Single(); Assert.That(meetingComment.Id, Is.EqualTo(meetingCommentId)); Assert.That(meetingComment.Comment, Is.EqualTo(comment)); Assert.That(meetingComment.AuthorId, Is.EqualTo(ExecutionContext.UserId)); Assert.That(meetingComment.CreateDate, Is.EqualTo(date)); Assert.That(meetingComment.EditDate, Is.Null); }
public async Task CreateMeetingCommentingCofiguration_WhenDataIsValid_IsSuccessful() { // Act var meetingId = await MeetingHelper.CreateMeetingAsync(MeetingsModule, ExecutionContext); // Assert var meetingCommentingConfiguration = await MeetingsModule.ExecuteQueryAsync(new GetMeetingCommentingConfigurationQuery(meetingId)); Assert.NotNull(meetingCommentingConfiguration); }
public async Task DisableMeetingCommenting_WhenDataIsValid_IsSuccess() { // Arrange var meetingId = await MeetingHelper.CreateMeetingAsync(MeetingsModule, ExecutionContext); // Act await MeetingsModule.ExecuteCommandAsync(new DisableMeetingCommentingConfigurationCommand(meetingId)); // Assert var meetingConfiguration = await MeetingsModule.ExecuteQueryAsync(new GetMeetingCommentingConfigurationQuery(meetingId)); Assert.NotNull(meetingConfiguration); Assert.False(meetingConfiguration.IsCommentingEnabled); }
public async Task GetMeetingComments_Test() { // Arrange var meetingId = await MeetingHelper.CreateMeetingAsync(MeetingsModule, ExecutionContext); await MeetingsModule.ExecuteCommandAsync( new AddMeetingCommentCommand(meetingId, "The meeting was great.")); await MeetingsModule.ExecuteCommandAsync( new AddMeetingCommentCommand(meetingId, "The meeting was wonderful.")); await MeetingsModule.ExecuteCommandAsync( new AddMeetingCommentCommand(meetingId, "The meeting was amazing.")); // Act var meetingComments = await MeetingsModule.ExecuteQueryAsync(new GetMeetingCommentsQuery(meetingId)); // Assert Assert.That(meetingComments.Count, Is.EqualTo(3)); }
public async Task RemoveMeetingComment_ByAuthor_WhenDataIsValid_IsSuccessful() { // Arrange var meetingId = await MeetingHelper.CreateMeetingAsync(MeetingsModule, ExecutionContext); var meetingCommentId = await MeetingsModule.ExecuteCommandAsync(new AddMeetingCommentCommand( meetingId, "The meeting was great.")); // Act await MeetingsModule.ExecuteCommandAsync(new RemoveMeetingCommentCommand( meetingCommentId, reason : string.Empty)); // Assert var meetingComments = await MeetingsModule.ExecuteQueryAsync(new GetMeetingCommentsQuery(meetingId)); Assert.IsEmpty(meetingComments); }