fast_rx_test

Last updated:

0 purchases

fast_rx_test Image
fast_rx_test Images
Add to Cart

Description:

fast rx test

Testing utilities for fast_rx





Features #



Method
Use-case




expectRx
Check for valid rx registration and notifications



Getting started #
See fast_rx
Usage #

import 'package:fast_rx_test/fast_rx_test.dart';
import 'package:test/test.dart';
import 'rx_tuple.dart';

void main() {
final shouldNotify = <RxTest<RxTuple<int, int>>>[
RxTest(() => Tuple(1, 2).rx, (rx) => rx.item1 = 3),
RxTest(() => Tuple(1, 2).rx, (rx) => rx.item2 = 3),
RxTest(
() => Tuple(1, 2).rx,
(rx) => rx.run(() {
rx.item1 = 3;
rx.item2 = 3;
}),
),
];
final shouldRegister = <RxTest<RxTuple<int, int>>>[
RxTest(() => Tuple(1, 2).rx, (rx) => rx.item1),
RxTest(() => Tuple(1, 2).rx, (rx) => rx.item2),
];
final shouldNotNotifyOrRegister = <RxTest<RxTuple<int, int>>>[
RxTest(() => Tuple(1, 2).rx, (rx) => rx.copyValue()),
RxTest(() => Tuple(1, 2).rx, (rx) => rx.shouldNotify(Tuple(2, 2))),
// ignore: invalid_use_of_protected_member
RxTest(() => Tuple(1, 2).rx, (rx) => rx.internalSetValue(Tuple(1, 3))),
];

test('RxObject registration and notifications', () {
expectRx(
shouldRegister: shouldRegister,
shouldNotRegister: shouldNotify + shouldNotNotifyOrRegister,
shouldNotify: shouldNotify,
shouldNotNotify: shouldRegister + shouldNotNotifyOrRegister,
);
});
}

copied to clipboard
Additional information #
See fast_ui for more information

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.