Skip to content

Instantly share code, notes, and snippets.

@ndungudedan
Last active May 14, 2022 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndungudedan/72b050148779e143c6dbe00a1d2cf1bb to your computer and use it in GitHub Desktop.
Save ndungudedan/72b050148779e143c6dbe00a1d2cf1bb to your computer and use it in GitHub Desktop.
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