tock / ai.tock.bot.test / BotBusMockContext

BotBusMockContext

data class BotBusMockContext (source)

The context of the test.

Constructors

<init>

BotBusMockContext(applicationId: String, userId: PlayerId, botId: PlayerId, botDefinition: BotDefinition, storyDefinition: StoryDefinition, action: Action = SendSentence(userId, applicationId, botId, ""), userInterfaceType: UserInterfaceType = UserInterfaceType.textChat, userPreferences: UserPreferences = UserPreferences(), connectorType: ConnectorType = defaultTestConnectorType, testContext: TestContext = currentTestContext)
BotBusMockContext(botDefinition: BotDefinition, storyDefinition: StoryDefinition, applicationId: String = botDefinition.botId, userId: PlayerId = PlayerId("user"), botId: PlayerId = PlayerId("bot", PlayerType.bot), action: Action = SendSentence(userId, applicationId, botId, ""), userInterfaceType: UserInterfaceType = UserInterfaceType.textChat, userPreferences: UserPreferences = UserPreferences(), connectorType: ConnectorType = defaultTestConnectorType, testContext: TestContext = currentTestContext)

The context of the test.

BotBusMockContext(userTimeline: UserTimeline, dialog: Dialog, story: Story, firstAction: Action, botDefinition: BotDefinition, i18nProvider: I18nKeyProvider, userInterfaceType: UserInterfaceType = UserInterfaceType.textChat, connectorType: ConnectorType = defaultTestConnectorType, testContext: TestContext = currentTestContext, snapshots: MutableList<Snapshot> = mutableListOf())

Properties

answers

The list of all bot answers recorded.

val answers: List<BotBusMockLog>

applicationId

val applicationId: String

botDefinition

var botDefinition: BotDefinition

botId

val botId: PlayerId

connectorType

var connectorType: ConnectorType

dialog

var dialog: Dialog

firstAction

var firstAction: Action

firstAnswer

The first answer recorded.

val firstAnswer: BotBusMockLog

i18nProvider

var i18nProvider: I18nKeyProvider

initialUserPreferences

val initialUserPreferences: UserPreferences

lastAnswer

The last answer recorded.

val lastAnswer: BotBusMockLog

secondAnswer

The second answer recorded.

val secondAnswer: BotBusMockLog

snapshots

val snapshots: MutableList<Snapshot>

story

var story: Story

testContext

val testContext: TestContext

thirdAnswer

The third answer recorded.

val thirdAnswer: BotBusMockLog

userId

val userId: PlayerId

userInterfaceType

var userInterfaceType: UserInterfaceType

userPreferences

val userPreferences: UserPreferences

userTimeline

var userTimeline: UserTimeline

Functions

choice

Create a choice for this context.

fun choice(intentName: String, vararg parameters: Pair<String, String>): SendChoice
fun choice(intentName: String, step: StoryStep<out StoryHandlerDefinition>, vararg parameters: Pair<String, String>): SendChoice
fun choice(intent: IntentAware, step: StoryStep<out StoryHandlerDefinition>, parameters: Parameters): SendChoice
fun choice(intent: IntentAware, parameters: Parameters = Parameters()): SendChoice

choiceOfId

Create a choice for this context.

fun choiceOfId(choiceId: String): SendChoice

resetUserPreferences

Reset user preferences.

fun resetUserPreferences(userPreferences: UserPreferences): Unit

sentence

Create a new sentence for this context.

fun sentence(text: String, vararg entityValues: EntityValue): SendSentence
fun sentence(text: String, entityValues: List<EntityValue> = emptyList()): SendSentence
fun sentence(text: String, intent: IntentAware? = null, vararg entityValues: EntityValue): SendSentence
fun sentence(text: String, intent: IntentAware? = null, entityValues: List<EntityValue> = emptyList()): SendSentence
fun sentence(message: ConnectorMessage, vararg entityValues: EntityValue): SendSentence
fun sentence(message: ConnectorMessage, entityValues: List<EntityValue> = emptyList()): SendSentence
fun sentence(message: ConnectorMessage, intent: IntentAware? = null, vararg entityValues: EntityValue): SendSentence
fun sentence(message: ConnectorMessage, intent: IntentAware? = null, entityValues: List<EntityValue> = emptyList()): SendSentence