Address Copilot review feedback: fix duplicate XML doc, make IsOrchestrationOwnedByWorkflow non-throwing, drop misleading Async suffix in test name
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -657,10 +657,6 @@ internal static class BuiltInFunctions
|
||||
return functionName[HttpPrefix.Length..];
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Extracts the workflow name from the function definition name by stripping the
|
||||
/// <see cref="HttpPrefix"/> and the given suffix (e.g., "-status" or "-respond").
|
||||
/// </summary>
|
||||
/// <summary>
|
||||
/// Extracts the workflow name from the function definition name by stripping the
|
||||
/// <see cref="HttpPrefix"/> and the given suffix (e.g., "-status" or "-respond").
|
||||
@@ -683,6 +679,12 @@ internal static class BuiltInFunctions
|
||||
/// </summary>
|
||||
internal static bool IsOrchestrationOwnedByWorkflow(string orchestrationName, string functionName, string suffix)
|
||||
{
|
||||
if (!functionName.StartsWith(HttpPrefix, StringComparison.Ordinal) ||
|
||||
!functionName.EndsWith(suffix, StringComparison.Ordinal))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
string workflowName = GetWorkflowName(functionName, suffix);
|
||||
string expectedOrchestrationName = WorkflowNamingHelper.ToOrchestrationFunctionName(workflowName);
|
||||
return string.Equals(orchestrationName, expectedOrchestrationName, StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ public sealed class BuiltInFunctionsWorkflowRoutingTests
|
||||
[InlineData("http-OrderProcessor-status", "-status", "OrderProcessor")]
|
||||
[InlineData("http-MyWorkflow-respond", "-respond", "MyWorkflow")]
|
||||
[InlineData("http-Multi-Dash-Name-status", "-status", "Multi-Dash-Name")]
|
||||
public void GetWorkflowName_ReturnsCorrectNameAsync(string functionName, string suffix, string expectedWorkflowName)
|
||||
public void GetWorkflowName_ReturnsCorrectName(string functionName, string suffix, string expectedWorkflowName)
|
||||
{
|
||||
// Act
|
||||
string result = BuiltInFunctions.GetWorkflowName(functionName, suffix);
|
||||
|
||||
Reference in New Issue
Block a user