Skip to content

Commit 984c34d

Browse files
committed
selectMany assert test
1 parent 28072ad commit 984c34d

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/store_test.dart

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,6 +1650,38 @@ void main() {
16501650
});
16511651

16521652
group('selectMany', () {
1653+
test('assert', () {
1654+
final store = RxReduxStore<int, String>(
1655+
initialState: 'initialState',
1656+
sideEffects: [],
1657+
reducer: (s, a) => s,
1658+
);
1659+
expect(
1660+
() => store.selectMany(
1661+
[(s) => s.length, (s) => s.isEmpty ? null : s[0]],
1662+
[null, null, null],
1663+
(subStates) => subStates,
1664+
),
1665+
throwsArgumentError,
1666+
);
1667+
expect(
1668+
() => store.selectMany<Object, Object>(
1669+
[],
1670+
[],
1671+
(subStates) => subStates,
1672+
),
1673+
throwsArgumentError,
1674+
);
1675+
expect(
1676+
() => store.selectMany(
1677+
[(s) => s.length],
1678+
[null],
1679+
(subStates) => subStates,
1680+
),
1681+
throwsArgumentError,
1682+
);
1683+
});
1684+
16531685
test('~= select2', () async {
16541686
final store = RxReduxStore<int, _State>(
16551687
initialState: _State(true, null, <String>[].build(), 1),

0 commit comments

Comments
 (0)