source/TestCommon/source/FunctionApp.TestCommon/FunctionAppHost/FunctionAppHostManagerExtensions.cs
/// <summary>
/// Determine if the <paramref name="functionName"/> was executed by searching the log.
/// </summary>
/// <param name="hostManager"></param>
/// <param name="functionName">For some azure function tool versions, this name must contain 'Functions.' as a prefix for the actual function name.</param>
/// <returns>True if the log contains any enry indicating the function was executed; otherwise false.</returns>
Determine if the  was executed by searching the log.
Determine if the was executed by searching the log .
public static bool CheckIfFunctionWasExecuted(this FunctionAppHostManager hostManager, string functionName)
        {
            if (hostManager is null)
            {
                throw new ArgumentNullException(nameof(hostManager));
            }
            return hostManager.GetHostLogSnapshot()
                .Any(log => log.Contains($"Executed '{functionName}'", StringComparison.OrdinalIgnoreCase));
        }
public static bool CheckIfFunctionWasExecuted ( this FunctionAppHostManager hostManager , string functionName ) { if ( hostManager is null ) { throw new ArgumentNullException ( nameof ( hostManager ) ) ; } return hostManager . GetHostLogSnapshot ( ) . Any ( log => log . Contains ( $" Executed ' { functionName } ' " , StringComparison . OrdinalIgnoreCase ) ) ; }
Determine if the  was executed by searching the log.
Determine if the was executed by searching the log .
True if the log contains any enry indicating the function was executed; otherwise false.
True if the log contains any enry indicating the function was executed ; otherwise false .
FunctionAppHostManager
this
functionName
string
For some azure function tool versions, this name must contain 'Functions.' as a prefix for the actual function name.
For some azure function tool versions this name must contain ' Functions . ' as a prefix for the actual function name .
hostManager
None