public async Task GetMembershipByGroupQueryHandler_ShouldMemberships()
        {
            // Arrange
            GetMembershipsByGroupQuery request = new GetMembershipsByGroupQuery {
                GroupId = 1
            };

            IEnumerable <GroupMembership> expectedMemberships = new []
            {
                new GroupMembership {
                    GroupMembershipId = 1, GroupId = 1
                },
                new GroupMembership {
                    GroupMembershipId = 2, GroupId = 1
                },
            };

            IQueryable <GroupMembership> queryableMock = expectedMemberships
                                                         .AsQueryable()
                                                         .BuildMock()
                                                         .Object;

            _unitOfWorkMock
            .Setup(m => m.GroupMemberships.GetByGroup(request.GroupId))
            .Returns(queryableMock);

            GetMembershipsByGroupQuery.Handler handler = new GetMembershipsByGroupQuery.Handler(_mapperMock, _unitOfWorkMock.Object);

            // Act
            IEnumerable <GroupMembershipResource> actualMemberships = await handler.Handle(request);

            // Assert
            Assert.NotNull(actualMemberships);
            Assert.Equal(2, actualMemberships.Count());
        }
    public async Task GetMembershipByGroupQueryHandler_ShouldMemberships()
    {
        // Arrange
        GetMembershipsByGroupQuery request = new GetMembershipsByGroupQuery {
            GroupId = 1
        };

        List <GroupMembership> expectedMemberships = new ()
        {
            new GroupMembership {
                GroupMembershipId = 1, GroupId = 1
            },
            new GroupMembership {
                GroupMembershipId = 2, GroupId = 1
            },
        };

        _unitOfWorkMock
        .Setup(m => m.GroupMemberships.GetByGroup(request.GroupId, It.IsAny <CancellationToken>()))
        .ReturnsAsync(expectedMemberships);

        GetMembershipsByGroupQuery.Handler handler = new GetMembershipsByGroupQuery.Handler(_mapperMock, _unitOfWorkMock.Object);

        // Act
        IEnumerable <GroupMembershipResource> actualMemberships = await handler.Handle(request);

        // Assert
        Assert.NotNull(actualMemberships);
        Assert.Equal(2, actualMemberships.Count());
    }