Table of Contents

Class RecordedTransactStep

Namespace
DynaSharp.Testing
Assembly
DynaSharp.Testing.dll

One action of a recorded TransactWriteItems or TransactGetItems, from TransactItems, so that a test says what a transaction did instead of walking BodyJson: steps[0].ReadItem<EmailClaim>(), steps[2].ConditionText.

public sealed class RecordedTransactStep
Inheritance
RecordedTransactStep
Inherited Members

Remarks

The texts follow the notation of RecordedRequest and use the placeholders of the step, because each action of a transaction has maps of its own. An action that sets several members, which only the request API can send and DynamoDB rejects, shows the first one.

Properties

ConditionText

Gets the ConditionExpression with its placeholders resolved, in the notation of RecordedRequest; null if the step has none.

public string? ConditionText { get; }

Property Value

string

Kind

Gets what the step does.

public TransactStepKind Kind { get; }

Property Value

TransactStepKind

ProjectionText

Gets the ProjectionExpression of a get with its placeholders resolved, in the notation of RecordedRequest; null if the step has none.

public string? ProjectionText { get; }

Property Value

string

TableName

Gets the table of the step, or null if it names none.

public string? TableName { get; }

Property Value

string

UpdateText

Gets the UpdateExpression of an update with its placeholders resolved, in the notation of RecordedRequest; null for the other kinds.

public string? UpdateText { get; }

Property Value

string

Methods

ReadItem()

Reads the Item of a put.

public Item ReadItem()

Returns

Item

A new item with the attributes as they went over the wire.

Exceptions

InvalidOperationException

The step has no Item.

ReadItem<T>()

Reads the Item of a put the way a response that carries it is read.

public T ReadItem<T>() where T : IDynamoDbDocument<T>

Returns

T

The value.

Type Parameters

T

The type to read: a generated entity or Item.

Exceptions

InvalidOperationException

The step has no Item.

DynamoDbMappingException

An attribute is missing or cannot be converted, or the item is of another type.

ReadKey()

Reads the Key of every kind but a put. KeyOf(IKey) gives what to compare it with.

public Item ReadKey()

Returns

Item

A new item with the key attributes.

Exceptions

InvalidOperationException

The step has no Key.

ReadKey<T>()

Reads the Key through a type, with the limits of ReadKey<T>().

public T ReadKey<T>() where T : IDynamoDbDocument<T>

Returns

T

The value.

Type Parameters

T

The type to read, which can be made from the key attributes alone.

Exceptions

InvalidOperationException

The step has no Key.

DynamoDbMappingException

An attribute is missing or cannot be converted.