adventures-in / chat_app

A group effort to build a chat app and learn as we go.
18 stars 0 forks source link

Add unit tests for DateTime extensions #201

Closed nickmeinhold closed 4 years ago

nickmeinhold commented 4 years ago

200 added extensions on DateTime that we haven't added tests for yet.

gaslitbytech commented 4 years ago

I have a draft of tests for isSameDate in branch feature/add-tests-date-time-extension-issue-201

One interesting thing is do we want to be able to compare with null? I believe it is worth it and that we should change the implementation to return false if other is null.

    test('.isSameDate() returns False when compared to null', () {
      var t0 = DateTime.parse('1969-07-20 20:18:04');
      DateTime t1;

      expect(false, t0.isSameDate(t1));
    }, skip: true);

I've found the skip flag which is useful so we can skip the test for now until we change functionality. skip will allow for better TDD testing before implementing.