Actions - GodelTech/GodelTech.StoryLine.Utils GitHub Wiki
GodelTech.StoryLine.Utils provides the following actions:
AddArtifactallows developer to add custom artifact to actor's artifact collection.Transformallows transformation of artifact into artifact of other type.Waitwaits for specified period of time. This option is useful if certain operation doesn't happen as immediate result of previous action.
AddArtifact
In certain cases it's required to add artifact in the middle of test scenario. This artifact may be based on result of previous operation. In order to support use case AddArtifact action is expected to be used. Here is example of usage:
Scenario.New()
.Given()
.HasPerformed<CreateTransaction>(x => x
.Status("Op"))
.HasPerformed<AddArtifact, TransactionDocument>((x, t) => x
.Value(CreateRefundRequest(t)))
....
.Run();
Transform
Transform action is use convert artifact of one type into another type. For example convert HTTP response to DTO which can be later used by expectation of other action. Here is example of usage:
.Performs<Transform, IResponse>((x, r) => x
.From(r.GetText())
.To<RefundDocument>()
.Using<JsonConverter>())
Transformer must implement IDataConverter interface. At the moment the only supported transformer is JsonConverter.
Wait
Wait operation waits for specific period of time. Interval is provided as TimeSpan value.