use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_hidden.
@Test
public void shouldShowToUser_hidden() {
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setHidden(true);
assertEquals(false, attachment.shouldShowToUser());
}
use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_locked_noUnlockDate.
@Test
public void shouldShowToUser_locked_noUnlockDate() {
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setLocked(true);
attachment.setUnlockAt(null);
assertEquals(false, attachment.shouldShowToUser());
}
use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_locked_unlockDateNotPassed.
@Test
public void shouldShowToUser_locked_unlockDateNotPassed() {
Date lockDate = new Date(System.currentTimeMillis() + MILLIS_PER_DAY);
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setUnlockAt(APIHelper.dateToString(lockDate));
attachment.setLocked(true);
assertEquals(false, attachment.shouldShowToUser());
}
use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_locked_unlockDatePassed.
@Test
public void shouldShowToUser_locked_unlockDatePassed() {
Date lockDate = new Date(System.currentTimeMillis() - MILLIS_PER_DAY);
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setUnlockAt(APIHelper.dateToString(lockDate));
attachment.setLocked(true);
assertEquals(true, attachment.shouldShowToUser());
}
Aggregations