Skip to content

Commit

Permalink
renamed ProgressingTaskStepDynamicFailAction to TaskStepActionResult
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenwezel committed Nov 12, 2024
1 parent ffa120c commit 877323a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CompuMaster.TaskManagement/ProgressingTaskStepBase.vb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Public MustInherit Class ProgressingTaskStepBase
''' <param name="taskstep"></param>
''' <returns></returns>

Public Delegate Function StepActionMethodWithFailAction(taskstep As ProgressingTaskStepBase) As ProgressingTaskStepDynamicFailAction
Public Delegate Function StepActionMethodWithFailAction(taskstep As ProgressingTaskStepBase) As TaskStepActionResult

Public Property ParentTask As ProgressingTaskItem
Public Property StepTitle As String
Expand Down Expand Up @@ -72,7 +72,7 @@ Public MustInherit Class ProgressingTaskStepBase
End Get
End Property

Friend Property StepExecutionResult As ProgressingTaskStepDynamicFailAction
Friend Property StepExecutionResult As TaskStepActionResult

Public Sub Run()
Select Case Me.Status
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
Public Class ProgressingTaskStepDynamicFailAction
''' <summary>
''' The result of a step action method
''' </summary>
Public Class TaskStepActionResult

Public Sub New()
Me.CompletedSuccessful = True
Expand Down
6 changes: 3 additions & 3 deletions CompuMaster.Test.TaskManagement/TaskBundleRunBehaviourTest.vb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Namespace CompuMaster.Test.TaskManagement
Dim TaskBundle As ProgressingTaskBundle
TaskBundle = DummyTaskBundlesExtended.DummyTaskBundleFailingStepActionWithFailAction(Function()
'Success => no exception, but dynamic result
Return New ProgressingTaskStepDynamicFailAction()
Return New TaskStepActionResult()
End Function)
TaskBundle.RunAllTasks()
System.Console.WriteLine(TaskBundle.DisplaySummary)
Expand Down Expand Up @@ -94,7 +94,7 @@ Namespace CompuMaster.Test.TaskManagement
Dim TaskBundle As ProgressingTaskBundle
TaskBundle = DummyTaskBundlesExtended.DummyTaskBundleFailingStepActionWithFailAction(Function()
'Catched exception failure - LogAndContinue
Return New ProgressingTaskStepDynamicFailAction(New CustomException("Failure-Test in Dummy" & System.Environment.NewLine & "with a 2nd line in exception message"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.LogExceptionAndContinue)
Return New TaskStepActionResult(New CustomException("Failure-Test in Dummy" & System.Environment.NewLine & "with a 2nd line in exception message"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.LogExceptionAndContinue)
End Function)
Assert.Catch(Of AggregateException)(Sub() TaskBundle.RunAllTasks())
System.Console.WriteLine(TaskBundle.DisplaySummary)
Expand All @@ -111,7 +111,7 @@ Namespace CompuMaster.Test.TaskManagement
Dim TaskBundle As ProgressingTaskBundle
TaskBundle = DummyTaskBundlesExtended.DummyTaskBundleFailingStepActionWithFailAction(Function()
'Catched exception failure - Throw
Return New ProgressingTaskStepDynamicFailAction(New CustomException("Failure-Test in Dummy" & System.Environment.NewLine & "with a 2nd line in exception message"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.ThrowException)
Return New TaskStepActionResult(New CustomException("Failure-Test in Dummy" & System.Environment.NewLine & "with a 2nd line in exception message"), ProgressingTaskStepBase.ProgressingTaskStepFailAction.ThrowException)
End Function)
Assert.Catch(Of AggregateException)(Sub() TaskBundle.RunAllTasks())
System.Console.WriteLine(TaskBundle.DisplaySummary)
Expand Down

0 comments on commit 877323a

Please sign in to comment.