public async Task <Unit> Handle(PresenceOnBarbecue request, CancellationToken cancellationToken)
        {
            var barbecue = await _barbecues.GetAll()
                           .Include(o => o.Presences)
                           .FirstOrDefaultAsync(o => o.Id == request.BarbecueId);

            if (barbecue == null)
            {
                _notifications.AddNotification(AppConsts.BarbecueNotFound);
                return(Unit.Value);
            }

            if (!barbecue.Presences.Any(o => o.ParticipantId == request.ParticipantId))
            {
                barbecue.UpdateDate = DateTime.Now;
                _presences.Add(new Presence(request.Value, request.BarbecueId, request.ParticipantId));
                await _presences.Commit();

                await _mediator.Publish(PresenceConfirmed.Notify(request.BarbecueId, request.Value));
            }

            return(Unit.Value);
        }
        public void Should_UpdateBarbecueValues_When_PresenceIsConfirmed()
        {
            var id            = Guid.NewGuid();
            var participantId = Guid.NewGuid();
            var barbecue      = new Barbecue
            {
                Id        = id,
                Presences = new List <Presence>
                {
                    new Presence
                    {
                        ParticipantId = participantId
                    }
                }
            };

            _context.Setup(o => o.GetAll()).Returns(new AsyncEnumerable <Barbecue>(new List <Barbecue> {
                barbecue
            }));
            _context.Setup(o => o.Commit());
            _handler.Handle(PresenceConfirmed.Notify(Guid.Empty, 12), default).GetAwaiter().GetResult();
            Mock.VerifyAll();
        }