Search in sources :

Example 1 with LockInfo

use of com.instructure.canvasapi2.models.LockInfo in project instructure-android by instructure.

the class AssignmentTest method isLocked_TestUnlockAfterCurrentDate.

@Test
public void isLocked_TestUnlockAfterCurrentDate() {
    Assignment assignment = new Assignment();
    LockInfo lockInfo = new LockInfo();
    long time = Calendar.getInstance().getTimeInMillis() + 100000;
    Date date = new Date(time);
    lockInfo.setUnlockAt(APIHelper.dateToString(date));
    assignment.setLockInfo(lockInfo);
    assertEquals(true, assignment.isLocked());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) LockInfo(com.instructure.canvasapi2.models.LockInfo) Date(java.util.Date) Test(org.junit.Test)

Example 2 with LockInfo

use of com.instructure.canvasapi2.models.LockInfo in project instructure-android by instructure.

the class AssignmentTest method isLocked_TestLockedModuleName.

@Test
public void isLocked_TestLockedModuleName() {
    Assignment assignment = new Assignment();
    LockInfo lockInfo = new LockInfo();
    LockedModule lockedModule = new LockedModule();
    lockedModule.setName("Hodor");
    lockInfo.setContextModule(lockedModule);
    assignment.setLockInfo(lockInfo);
    assertEquals(true, assignment.isLocked());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) LockedModule(com.instructure.canvasapi2.models.LockedModule) LockInfo(com.instructure.canvasapi2.models.LockInfo) Test(org.junit.Test)

Example 3 with LockInfo

use of com.instructure.canvasapi2.models.LockInfo in project instructure-android by instructure.

the class AssignmentTest method isLocked_TestEmptyLockInfo.

@Test
public void isLocked_TestEmptyLockInfo() {
    Assignment assignment = new Assignment();
    LockInfo lockInfo = new LockInfo();
    assignment.setLockInfo(lockInfo);
    assertEquals(false, assignment.isLocked());
}
Also used : Assignment(com.instructure.canvasapi2.models.Assignment) LockInfo(com.instructure.canvasapi2.models.LockInfo) Test(org.junit.Test)

Aggregations

Assignment (com.instructure.canvasapi2.models.Assignment)3 LockInfo (com.instructure.canvasapi2.models.LockInfo)3 Test (org.junit.Test)3 LockedModule (com.instructure.canvasapi2.models.LockedModule)1 Date (java.util.Date)1