Last active
May 14, 2022 23:05
-
-
Save ndungudedan/72b050148779e143c6dbe00a1d2cf1bb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
group("Favorites class test", () { | |
test('testing add function', () { | |
var note = Note(description: 'description', title: 'title'); | |
final fav = Favorites(); | |
fav.add(note); | |
expect(fav.items.length, 1); | |
expect(fav.items.contains(note), true); | |
}); | |
test('removing a note', () { | |
var note = Note(description: 'description', title: 'title'); | |
final fav = Favorites(); | |
fav.add(note); | |
expect(fav.items.length, 1); | |
expect(fav.items.contains(note), true); | |
fav.remove(fav.items.indexOf(note)); | |
expect(fav.items.length, 0); | |
expect(fav.items.contains(note), false); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment