# RxTest

Version: 0.5.0
Framework commit: d503df2befa756e681fcdc6250e9552dc7388bea
Canonical URL: /docs/0.5.0/api/ferroui-reactiveui-testing/struct-rxtest/

**struct** · [`ferroui-reactiveui-testing`](/docs/0.5.0/api/ferroui-reactiveui-testing/) · v0.5.0

```rust
struct RxTest
```

Runs a test of the application builder of Splat from a clean builder state, one test at a time
and within a time limit (`RxTest`).

Deviation (DEVIATIONS.md, ReactiveUI): the state of the application builder is per thread, as
the rest of the state of ReactiveUI and Splat is, so the gate lets one test of the thread run
at a time, not one of the process.

[View source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Testing/rx_test.rs#L113)

## Members

- [`app_builder_test_async`](#function-app_builder_test_async)
- [`app_builder_test_async_with`](#function-app_builder_test_async_with)

<a id="function-app_builder_test_async"></a>

### app_builder_test_async

```rust
fn app_builder_test_async<Fut: Future<Output = Result<(), ObservableError>> + 'static>(test_body: impl FnOnce() -> Fut + 'static) -> Shared<Result<(), ObservableError>>
```

`app_builder_test_async_with` with the default time
limit of 60 seconds (`AppBuilderTestAsync(Func<Task>)`).

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Testing/rx_test.rs#L118)

<a id="function-app_builder_test_async_with"></a>

### app_builder_test_async_with

```rust
fn app_builder_test_async_with<Fut: Future<Output = Result<(), ObservableError>> + 'static>(test_body: impl FnOnce() -> Fut + 'static, max_wait_ms: u64) -> Shared<Result<(), ObservableError>>
```

Runs `test_body` once no other test of the application builder runs, with the state of the
application builder reset before and after it, and gives a task that ends as the test does,
the `Shared` of its result (`AppBuilderTestAsync(Func<Task>, int)`). The test body gives a
future of a `Result<(), ObservableError>`, which runs as a task of the thread.

The task ends with a `TimeoutError` when the gate is not free within `max_wait_ms`
milliseconds, or when the test runs longer than that; with the error of the test when it
fails, and with the error of a panic (`PanicError`) when `test_body` panics, as an
exception thrown in an `async` method faults its task.

Not ported: the `ArgumentException` of a null test body - argument validation.

[Source](https://github.com/wieslawsoltes/FerroUI/blob/d503df2befa756e681fcdc6250e9552dc7388bea/src/FerroUI.ReactiveUI.Testing/rx_test.rs#L135)

## Trait implementations

- `Send`
- `Sync`
- `Freeze`
- `UnsafeUnpin`
- `Unpin`
- `UnwindSafe`
- `RefUnwindSafe`
- `Borrow<T>`
- `BorrowMut<T>`
- `Into<U>`
- `From<T>`
- `TryInto<U>`
- `TryFrom<U>`
- `Any`

## Availability

Extracted for `aarch64-apple-darwin`. Cargo features are listed in the [crate index](/docs/0.5.0/api/).
