diff --git a/testing_app/test/favorites_test.dart b/testing_app/test/favorites_test.dart index 177c6673f..e061a6f95 100644 --- a/testing_app/test/favorites_test.dart +++ b/testing_app/test/favorites_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:math'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:provider/provider.dart'; @@ -21,9 +20,9 @@ Widget createFavoritesScreen() => ChangeNotifierProvider( ), ); -void addRandomItems() { +void addItems() { for (var i = 0; i < 5; i++) { - favoritesList.add(Random().nextInt(50)); + favoritesList.add(i); } } @@ -32,8 +31,7 @@ void main() { testWidgets('Test if ListView shows up', (tester) async { await tester.pumpWidget(createFavoritesScreen()); - // Add random values. - addRandomItems(); + addItems(); await tester.pumpAndSettle(); // Verify if ListView shows up. @@ -43,8 +41,7 @@ void main() { testWidgets('Testing Remove Button', (tester) async { await tester.pumpWidget(createFavoritesScreen()); - // Add random values. - addRandomItems(); + addItems(); await tester.pumpAndSettle(); // Get the total number of items available. diff --git a/testing_app/test/models/favorites_test.dart b/testing_app/test/models/favorites_test.dart index 912be7e9d..5f0224929 100644 --- a/testing_app/test/models/favorites_test.dart +++ b/testing_app/test/models/favorites_test.dart @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -import 'dart:math'; import 'package:test/test.dart'; import 'package:testing_app/models/favorites.dart'; @@ -13,7 +12,7 @@ void main() { test('A new item should be added', () { // Generate a random number. - var number = Random().nextInt(50); + var number = 35; // Add the number to the list. favorites.add(number); @@ -24,7 +23,7 @@ void main() { test('An item should be removed', () { // Generate a random number. - var number = Random().nextInt(50); + var number = 45; // Add the number to the list. favorites.add(number);