Show / Hide Table of Contents

Class TestBotAction

An enum-based test bot action.

Inheritance
object
EnumWrapper<TestBotActionType, TestBotAction>
TestBotAction
Implements
IEquatable<TestBotAction>
IOperation<TestAutomatedBot>
IOperation
Inherited Members
EnumWrapper<TestBotActionType, TestBotAction>.Value
EnumWrapper<TestBotActionType, TestBotAction>.Equals(TestBotAction)
EnumWrapper<TestBotActionType, TestBotAction>.ToString()
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
Namespace: Microsoft.XboxStudios.BotBrain.Samples.EnumBased
Assembly: BotBrain.Samples.dll
Syntax
public class TestBotAction : EnumWrapper<TestBotActionType, TestBotAction>, IEquatable<TestBotAction>, IOperation<TestAutomatedBot>, IOperation
Remarks

Initializes a new instance of the TestBotAction class.

Constructors

View Source

TestBotAction(TestBotActionType, bool)

Initializes a new instance of the TestBotAction class.

Declaration
public TestBotAction(TestBotActionType type = TestBotActionType.Move, bool generateName = true)
Parameters
Type Name Description
TestBotActionType type

The action type.

bool generateName

True to generate a default name based on the type.

View Source

TestBotAction(TestBotActionType, string?)

An enum-based test bot action.

Declaration
[JsonConstructor]
public TestBotAction(TestBotActionType value, string? name)
Parameters
Type Name Description
TestBotActionType value

The action type.

string name

The action name.

Remarks

Initializes a new instance of the TestBotAction class.

Properties

View Source

ErrorRate

Gets or sets the error rate, or how often the action fails.

Declaration
public float ErrorRate { get; set; }
Property Value
Type Description
float
View Source

ErrorsAreCancellations

Gets or sets a value indicating whether or not errors are cancellations or regular exceptions.

Declaration
public bool ErrorsAreCancellations { get; set; }
Property Value
Type Description
bool
View Source

IsRunning

Gets a value indicating whether or not the operation is running.

Declaration
public bool IsRunning { get; }
Property Value
Type Description
bool
View Source

IsSuccessful

Gets a value indicating whether or not the action was successful.

Declaration
public bool IsSuccessful { get; }
Property Value
Type Description
bool
View Source

Name

Gets or sets the action name.

Declaration
public string? Name { get; set; }
Property Value
Type Description
string
View Source

RunDelay

Gets or sets the amount of time the action runs.

Declaration
public TimeSpan RunDelay { get; set; }
Property Value
Type Description
TimeSpan

Methods

View Source

Equals(object?)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
object.Equals(object)
View Source

GetAwaiter(TestAutomatedBot, CancellationToken)

Gets a task used to await this operation on an item.

Declaration
public Task<bool> GetAwaiter(TestAutomatedBot item, CancellationToken token)
Parameters
Type Name Description
TestAutomatedBot item

The item to use.

CancellationToken token

A token to monitor for cancellation.

Returns
Type Description
Task<bool>

A task.

View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
View Source

IsRunningOn(TestAutomatedBot)

Gets a value indicating whether or not the operation is running on an item.

Declaration
public bool IsRunningOn(TestAutomatedBot item)
Parameters
Type Name Description
TestAutomatedBot item

The item to use.

Returns
Type Description
bool

True if the operation is running on the item.

View Source

Run(TestAutomatedBot)

Runs the operation on an item.

Declaration
public Task<bool> Run(TestAutomatedBot item)
Parameters
Type Name Description
TestAutomatedBot item

The item.

Returns
Type Description
Task<bool>

A task that returns when the operation completes.

View Source

ToString()

Returns a string that represents the current object.

Declaration
public override string ToString()
Returns
Type Description
string

A string that represents the current object.

Overrides
EnumWrapper<TestBotActionType, TestBotAction>.ToString()
View Source

ToTestBotAction(TestBotActionType)

Converts an action type to an action.

Declaration
public static TestBotAction ToTestBotAction(TestBotActionType value)
Parameters
Type Name Description
TestBotActionType value

The action type.

Returns
Type Description
TestBotAction

The action.

Operators

View Source

implicit operator TestBotAction(TestBotActionType)

Converts an action type to an action.

Declaration
public static implicit operator TestBotAction(TestBotActionType value)
Parameters
Type Name Description
TestBotActionType value

The action type.

Returns
Type Description
TestBotAction

Implements

IEquatable<T>
IOperation<T>
IOperation
  • View Source
In this article
Back to top Generated by DocFX