public async Task Invalidate_when_invite_is_for_other_user()
        {
            var sut = new AcceptGroupInviteValidator(_dbContext);

            // Arrange
            string userSub = Guid.NewGuid().ToString();
            var    user    = new DeUrgenta.Domain.Entities.User
            {
                FirstName = "user",
                LastName  = "user",
                Sub       = userSub
            };

            string otherUserSub = Guid.NewGuid().ToString();
            var    otherUser    = new DeUrgenta.Domain.Entities.User
            {
                FirstName = "other",
                LastName  = "user",
                Sub       = otherUserSub
            };

            string adminSub = Guid.NewGuid().ToString();
            var    admin    = new DeUrgenta.Domain.Entities.User
            {
                FirstName = "Admin",
                LastName  = "Test",
                Sub       = adminSub
            };

            await _dbContext.Users.AddAsync(user);

            await _dbContext.Users.AddAsync(admin);

            await _dbContext.Users.AddAsync(otherUser);

            var group = new Group
            {
                Admin = admin,
                Name  = "group"
            };

            await _dbContext.Groups.AddAsync(group);

            var groupInvite = new GroupInvite
            {
                InvitationReceiver = user,
                InvitationSender   = admin,
                Group = group
            };

            await _dbContext.GroupInvites.AddAsync(groupInvite);

            await _dbContext.SaveChangesAsync();

            // Act
            bool isValid = await sut.IsValidAsync(new AcceptGroupInvite(userSub, Guid.NewGuid()));

            // Assert
            isValid.ShouldBeFalse();
        }
        public async Task Invalidate_request_when_no_user_found_by_sub(string sub)
        {
            // Arrange
            var sut = new AcceptGroupInviteValidator(_dbContext);

            // Act
            bool isValid = await sut.IsValidAsync(new AcceptGroupInvite(sub, Guid.NewGuid()));

            // Assert
            isValid.ShouldBeFalse();
        }
        public async Task Invalidate_when_invite_does_not_exist()
        {
            var sut = new AcceptGroupInviteValidator(_dbContext);

            // Arrange
            string userSub = Guid.NewGuid().ToString();
            var    user    = new DeUrgenta.Domain.Entities.User
            {
                FirstName = "Integration",
                LastName  = "Test",
                Sub       = userSub
            };

            string adminSub = Guid.NewGuid().ToString();
            var    admin    = new DeUrgenta.Domain.Entities.User
            {
                FirstName = "Admin",
                LastName  = "Test",
                Sub       = adminSub
            };

            await _dbContext.Users.AddAsync(user);

            await _dbContext.Users.AddAsync(admin);

            var group = new Group
            {
                Admin = admin,
                Name  = "group"
            };

            await _dbContext.Groups.AddAsync(group);

            await _dbContext.SaveChangesAsync();

            // Act
            bool isValid = await sut.IsValidAsync(new AcceptGroupInvite(userSub, Guid.NewGuid()));

            // Assert
            isValid.ShouldBeFalse();
        }