public void Should_not_update_flow_variables_if_variables_do_not_exist() { // assemble var flow = new FlowInstance(); var sut = new CollectDataStep(new List <IValidationRule>(new[] { new StringRequired { VariableKey = "Variable1" } })); // act sut.Process(flow, null); sut.Process(flow, null); // assert Assert.Equal(0, flow.Variables.Count); }
public void Should_continue_when_rules_statisfied() { // assemble var flow = new FlowInstance(); var sut = new CollectDataStep(new List <IValidationRule>(new[] { new StringRequired { VariableKey = "Variable1" } })); // act sut.Process(flow, null); flow.Variables.Add("Variable1", ""); sut.Process(flow, null); // assert Assert.False(sut.CanContinue); Assert.True(sut.IsProcessed); }
public void Should_require_data_collection_if_exit_rule_invalid() { // assemble var sut = new CollectDataStep(new List <IValidationRule>(new[] { new StringRequired() })); // act sut.Process(new FlowInstance(), null); // assert Assert.False(sut.CanContinue); Assert.True(sut.IsProcessed); }
public void Should_return_true_when_no_rules_to_validate_and_processed() { // assemble var sut = new CollectDataStep(); // act sut.Process(new FlowInstance(), null); // assert Assert.True(sut.CanContinue); Assert.True(sut.IsProcessed); }