Skip to content

Commit

Permalink
Merge pull request #142 from mikev-cw/main
Browse files Browse the repository at this point in the history
Fix Tests
  • Loading branch information
mikev-cw authored Feb 2, 2024
2 parents c446b09 + 590e478 commit 89f6cbc
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion lib/database/sossoldi_database.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class SossoldiDatabase {
// First initialize some config stuff
final rnd = Random();
var accounts = [70,71,72];
var outNotes = ['Grocery', 'Tolls', 'Toys', 'Tobacco', 'Concert', 'Clothing', 'Pizza', 'Drugs', 'Laundry', 'Taxes', 'Health insurance', 'Furniture', 'Car Fuel', 'Train', 'Amazon', 'Delivery', 'CHEK dividends', 'Babysitter', 'sono.pove.ro Fees', 'Quingentole trip'];
var outNotes = ['Grocery', 'Tolls', 'Toys', 'ETF Consultant Parcel', 'Concert', 'Clothing', 'Pizza', 'Drugs', 'Laundry', 'Taxes', 'Health insurance', 'Furniture', 'Car Fuel', 'Train', 'Amazon', 'Delivery', 'CHEK dividends', 'Babysitter', 'sono.pove.ro Fees', 'Quingentole trip'];
var categories = [10,11,12,13,14];
int countOfGeneratedTransaction = 10000;
double maxAmountOfSingleTransaction = 250.00;
Expand Down
9 changes: 4 additions & 5 deletions test/model/bank_account_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import 'package:sossoldi/model/bank_account.dart';
import 'package:sossoldi/model/base_entity.dart';
import 'package:sossoldi/model/transaction.dart';
import 'package:sqflite/sqflite.dart' as sqflite;
import 'package:sqflite_common_ffi/sqflite_ffi.dart' as sqfliteFfi;
import 'package:sqflite_common_ffi/sqflite_ffi.dart' as sqflite_ffi;

import '../test_utils/sql_utils.dart';

Expand Down Expand Up @@ -89,10 +89,9 @@ void main() {
late sqflite.Database db;

setUpAll(() async {
if(Platform.isWindows | Platform.isLinux){
sqfliteFfi.sqfliteFfiInit();
sqfliteFfi.databaseFactory = sqfliteFfi.databaseFactoryFfi;
}
sqflite_ffi.sqfliteFfiInit();
sqflite_ffi.databaseFactory = sqflite_ffi.databaseFactoryFfi;

sossoldiDatabase = SossoldiDatabase(dbName: 'test.db');
db = await sossoldiDatabase.database;
await sossoldiDatabase.clearDatabase();
Expand Down
11 changes: 5 additions & 6 deletions test/model/transaction_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:sossoldi/database/sossoldi_database.dart';
import 'package:sossoldi/model/transaction.dart';
import 'package:sossoldi/model/base_entity.dart';
import 'package:sqflite/sqflite.dart' as sqflite;
import 'package:sqflite_common_ffi/sqflite_ffi.dart' as sqfliteFfi;
import 'package:sqflite_common_ffi/sqflite_ffi.dart' as sqflite_ffi;

import '../test_utils/sql_utils.dart';

Expand Down Expand Up @@ -104,7 +104,8 @@ void main() {
recurrencyType: null,
recurrencyPayDay: null,
recurrencyFrom: null,
recurrencyTo: null);
recurrencyTo: null
);

Map<String, Object?> json = t.toJson();

Expand All @@ -129,10 +130,8 @@ void main() {
late sqflite.Database db;

setUpAll(() async {
if(Platform.isWindows | Platform.isLinux){
sqfliteFfi.sqfliteFfiInit();
sqfliteFfi.databaseFactory = sqfliteFfi.databaseFactoryFfi;
}
sqflite_ffi.sqfliteFfiInit();
sqflite_ffi.databaseFactory = sqflite_ffi.databaseFactoryFfi;
sossoldiDatabase = SossoldiDatabase(dbName: 'test.db');
db = await sossoldiDatabase.database;
await sossoldiDatabase.clearDatabase();
Expand Down

0 comments on commit 89f6cbc

Please sign in to comment.