RunicTestDialogAnswer class

Namespace Runic.Application.Testing in Runic.Application.Testing 0.23.0

public sealed class RunicTestDialogAnswer

How the user of a RunicTestHost answers a dialog or context menu (RunicTestHostOptions.FileDialog, RunicTestHostOptions.MessageBox, RunicTestHostOptions.ContextMenu), or how the host's platform or policy turns it away.

Methods

Choose

public static RunicTestDialogAnswer Choose(string? id)

The user chose a message box's button or a context menu's item, by its id; null for none.

Parameters

id

The id, such as from RunicTestHostedWindow.FindMenuItem.

Returns

The answer.

Dismiss

public static RunicTestDialogAnswer Dismiss()

The user closed the dialog or menu without a choice: a file dialog is dismissed, a box returns no button.

Returns

The answer.

Fail

public static RunicTestDialogAnswer Fail(PlatformFailureCode code)

The host's platform failed to show it, with a failure code (a failed outcome).

Parameters

code

The code.

Returns

The answer.

Refuse

public static RunicTestDialogAnswer Refuse(string? message = null)

The host's policy refuses it (rejected, refused): the guest receives PlatformFailureCode.PermissionDenied.

Parameters

message

Why, for the guest.

Returns

The answer.

Select

public static RunicTestDialogAnswer Select(IReadOnlyList<string> paths, int? filter = null)

The user selected files or directories in a file dialog, and the filter of the index in RunicTestDialogRequest.FilterNames.

Parameters

paths

The absolute paths, at least one.

filter

The index of the filter the user chose, or null.

Returns

The answer.

Exceptions

ArgumentException

A path is not absolute, or there is none.

Unavailable

public static RunicTestDialogAnswer Unavailable(PlatformUnavailableReason reason)

The host could not show it (an unavailable outcome), such as PlatformUnavailableReason.OwnerClosed.

Parameters

reason

The reason.

Returns

The answer.