public async Task DeleteAsync_GivenUnfindableGuid_ThrowsItemNotFoundException()
        {
            // Arrange
            var functionRepository    = Substitute.For <IFunctionRepository>();
            var permissionRepository  = Substitute.For <IPermissionRepository>();
            var applicationRepository = Substitute.For <IApplicationRepository>();
            var subRealmRepository    = Substitute.For <ISubRealmRepository>();

            var functionService = new FunctionService(functionRepository, permissionRepository, applicationRepository, subRealmRepository, mapper);

            // Act
            Exception caughEx = null;

            try
            {
                await functionService.DeleteAsync(mockedFunctionModel.Id);
            }
            catch (Exception ex)
            {
                caughEx = ex;
            }

            // Assert
            Assert.True(caughEx is ItemNotFoundException, "Delete on a findable GUID must throw an ItemNotFoundException.");
        }
        public async Task DeleteAsync_GivenFindableGuid_ExecutesSuccessfully()
        {
            // Arrange
            var functionRepository    = Substitute.For <IFunctionRepository>();
            var permissionRepository  = Substitute.For <IPermissionRepository>();
            var applicationRepository = Substitute.For <IApplicationRepository>();
            var subRealmRepository    = Substitute.For <ISubRealmRepository>();

            functionRepository.GetByIdAsync(mockedFunctionModel.Id).Returns(mockedFunctionModel);

            var functionService = new FunctionService(functionRepository, permissionRepository, applicationRepository, subRealmRepository, mapper);

            // Act
            Exception caughEx = null;

            try
            {
                await functionService.DeleteAsync(mockedFunctionModel.Id);
            }
            catch (Exception ex)
            {
                caughEx = ex;
            }

            // Assert
            Assert.True(caughEx is null, "Delete on a findable GUID must execute successfully.");
        }