Skip to content

Commit 4fb02d3

Browse files
author
SpiritMachine
committed
Workflow<T> implements IWorkflow<T> again.
1 parent 2741d35 commit 4fb02d3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/Enflow.Base.Test/WorkflowTests.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,12 @@ public void ThrowsErrorOnInvalidPreBusinessRuleAndDoesNotExecute()
5656
Assert.Equal(description, message);
5757
Assert.Equal(0, model.Counter);
5858
}
59+
60+
[Fact]
61+
public void WorkflowOfTAssignabletoIWorkflowOfT()
62+
{
63+
var workflow = new GuidCountIncrementWorkflow(Substitute.For<IStateRule<GuidCount>>());
64+
Assert.NotNull(workflow as IWorkflow<GuidCount>);
65+
}
5966
}
6067
}

src/Enflow.Base/Workflow.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ private static void ValidateStateRule(T candidate, IStateRule<T> rule)
3232
if (rule == null) return;
3333
if (!rule.IsSatisfied(candidate)) throw new StateRuleException(rule.Description);
3434
}
35-
}
36-
37-
public abstract class Workflow<T> : Workflow<T, T>
35+
}
36+
37+
public abstract class Workflow<T> : Workflow<T, T>, IWorkflow<T>
3838
{
3939
protected Workflow() { }
4040
protected Workflow(IStateRule<T> preStateRule) : base(preStateRule) { }

0 commit comments

Comments
 (0)