Skip to content

Commit

Permalink
Corrected test and added asserts to check emptyStrings at ColloscopeC…
Browse files Browse the repository at this point in the history
…lient init
  • Loading branch information
FlashOnFire committed Oct 20, 2023
1 parent 49b0139 commit f4e62b7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import 'consts.dart';
class PolytechColloscopeClient {
final String username, password;

PolytechColloscopeClient(this.username, this.password);
PolytechColloscopeClient(this.username, this.password) {
assert(username.isNotEmpty);
assert(password.isNotEmpty);
}

Future<List<Student>> fetchStudents(Year year) async {
var page = await RequestsPlus.get(Consts.kholleURL[year]!,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Future<void> main() async {
fail("username or password were empty. check your envt variables");
}

PolytechColloscopeClient client = PolytechColloscopeClient("", "");
PolytechColloscopeClient client =
PolytechColloscopeClient(username, password);

var students = await client.fetchStudents(Year.first);
print(students);
Expand Down

0 comments on commit f4e62b7

Please sign in to comment.