You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
668 B
19 lines
668 B
import 'dart:async';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:thesis_shop/models/remote_resource.dart';
|
|
import 'package:thesis_shop/store/cart_store.dart';
|
|
|
|
import 'product_service_mock.dart';
|
|
|
|
void main() {
|
|
test('test cart store', () async {
|
|
final cartStore = CartStore();
|
|
cartStore.updateProductList(const RemoteResource.finished(demoProducts));
|
|
final callbackStream = StreamController();
|
|
cartStore.addListener(() => callbackStream.add(true));
|
|
cartStore.increaseAmount(demoProducts.first);
|
|
expect(cartStore.amountOfProduct(demoProducts.first), 1);
|
|
await expectLater(callbackStream.stream, emits(true));
|
|
});
|
|
}
|
|
|