public async Task CreatePermission_ShouldWork(
            IFixture fixture,
            [Frozen] Mock <IPermissionRepository> mockRepository,
            [Frozen] Mock <IMapper> mockMapper,
            Permission permission,
            PermissionService sut)
        {
            //Arrange
            var permissionRequest = fixture.Create <DTO.PermissionRequest>();

            mockMapper.Setup(m => m.Map <Permission>(permissionRequest)).Returns(permission);
            mockRepository.Setup(p => p.AddPermissionAsync(permission));

            //Act
            var result = await sut.CreateAsync(permissionRequest);

            //Assert
            Assert.Equal(1, result);
            mockMapper.Verify(m => m.Map <Permission>(permissionRequest), Times.Once);
            mockRepository.Verify(r => r.AddPermissionAsync(permission), Times.Once);
            mockRepository.Verify(r => r.SaveAsync(), Times.Once);
        }
        public async Task CreatePermission_ShouldDBThrowEntityNotFoundException(
            IFixture fixture,
            [Frozen] Mock <IPermissionRepository> mockRepository,
            [Frozen] Mock <IMapper> mockMapper,
            PermissionService sut)
        {
            //Arrange
            var permission = fixture.Create <Permission>();
            var dto        = fixture.Create <DTO.PermissionRequest>();

            mockMapper.Setup(m => m.Map <Permission>(dto)).Returns(permission);
            mockRepository.Setup(p => p.AddPermissionAsync(permission)).Throws(new EntityNotFoundException(ForeignConstraintErrorMsg));

            //Act
            Task act() => sut.CreateAsync(dto);

            //Assert
            var exception = await Assert.ThrowsAsync <EntityNotFoundException>(act);

            Assert.Equal(ForeignConstraintErrorMsg, exception.Message);
            mockMapper.Verify(m => m.Map <Permission>(dto), Times.Once);
            mockRepository.Verify(r => r.AddPermissionAsync(permission), Times.Once);
            mockRepository.Verify(r => r.SaveAsync(), Times.Never);
        }