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.
25 lines
744 B
25 lines
744 B
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:mobx/mobx.dart';
|
|
import 'package:mobx/src/api/async.dart';
|
|
import 'package:thesis_shop/models/product.dart';
|
|
import 'package:thesis_shop/stores/cart_store.dart';
|
|
import 'package:thesis_shop/stores/product_store.dart';
|
|
|
|
import 'product_service_mock.dart';
|
|
|
|
class MockedProductStore implements ProductStore {
|
|
@override
|
|
void loadProducts() {}
|
|
|
|
@override
|
|
ObservableFuture<List<Product>> products =
|
|
ObservableFuture.value(demoProducts);
|
|
}
|
|
|
|
void main() {
|
|
test('test cart store', () {
|
|
final cartStore = CartStore(MockedProductStore());
|
|
cartStore.incrementAmountOfProduct(demoProducts.first);
|
|
expect(cartStore.amountOfProduct(demoProducts.first), 1);
|
|
});
|
|
}
|
|
|