use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_lockedForUser_noUnlockDate.
@Test
public void shouldShowToUser_lockedForUser_noUnlockDate() {
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setLockedForUser(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_hiddenForUser.
@Test
public void shouldShowToUser_hiddenForUser() {
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setHiddenForUser(true);
assertEquals(false, attachment.shouldShowToUser());
}
use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_lockedForUser_unlockDatePassed.
@Test
public void shouldShowToUser_lockedForUser_unlockDatePassed() {
Date lockDate = new Date(System.currentTimeMillis() - MILLIS_PER_DAY);
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setUnlockAt(APIHelper.dateToString(lockDate));
attachment.setLockedForUser(true);
assertEquals(true, attachment.shouldShowToUser());
}
use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_unlockedAndVisible.
@Test
public void shouldShowToUser_unlockedAndVisible() {
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setHidden(false);
attachment.setHiddenForUser(false);
attachment.setLocked(false);
attachment.setLockedForUser(false);
assertEquals(true, attachment.shouldShowToUser());
}
use of com.instructure.canvasapi2.models.DiscussionAttachment in project instructure-android by instructure.
the class DiscussionAttachmentTest method shouldShowToUser_lockedForUser_unlockDateNotPassed.
@Test
public void shouldShowToUser_lockedForUser_unlockDateNotPassed() {
Date lockDate = new Date(System.currentTimeMillis() + MILLIS_PER_DAY);
DiscussionAttachment attachment = new DiscussionAttachment();
attachment.setUnlockAt(APIHelper.dateToString(lockDate));
attachment.setLockedForUser(true);
assertEquals(false, attachment.shouldShowToUser());
}
Aggregations