Search in sources :

Example 1 with LockedModule

use of com.instructure.canvasapi2.models.LockedModule 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 2 with LockedModule

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

the class LockedModuleTest method isLockedModuleValid_NullPrerequisites.

@Test
public void isLockedModuleValid_NullPrerequisites() {
    LockedModule module = getValidLockedModule();
    module.setPrerequisites(null);
    assertEquals(false, LockedModule.isLockedModuleValid(module));
}
Also used : LockedModule(com.instructure.canvasapi2.models.LockedModule) Test(org.junit.Test)

Example 3 with LockedModule

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

the class LockedModuleTest method isLockedModuleValid_InvalidUnlockDate.

@Test
public void isLockedModuleValid_InvalidUnlockDate() {
    LockedModule module = getValidLockedModule();
    module.setUnlockAt(null);
    assertEquals(false, LockedModule.isLockedModuleValid(module));
}
Also used : LockedModule(com.instructure.canvasapi2.models.LockedModule) Test(org.junit.Test)

Example 4 with LockedModule

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

the class LockedModuleTest method isLockedModuleValid_ValidModule.

@Test
public void isLockedModuleValid_ValidModule() {
    LockedModule module = getValidLockedModule();
    assertEquals(true, LockedModule.isLockedModuleValid(module));
}
Also used : LockedModule(com.instructure.canvasapi2.models.LockedModule) Test(org.junit.Test)

Example 5 with LockedModule

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

the class LockedModuleTest method isLockedModuleValid_InvalidName.

@Test
public void isLockedModuleValid_InvalidName() {
    LockedModule module = getValidLockedModule();
    module.setName(null);
    assertEquals(false, LockedModule.isLockedModuleValid(module));
}
Also used : LockedModule(com.instructure.canvasapi2.models.LockedModule) Test(org.junit.Test)

Aggregations

LockedModule (com.instructure.canvasapi2.models.LockedModule)7 Test (org.junit.Test)6 Assignment (com.instructure.canvasapi2.models.Assignment)1 LockInfo (com.instructure.canvasapi2.models.LockInfo)1