	@Test
	public void testGetDeviceStatus() throws IOException {


		// test io-exception

		try {

			controller.getDeviceStatus();

			fail("Excpected IOException (but there is no) because "
					+ "I2CDevice-mock is not initialized yet!");

		} catch (IOException e) {
			// expected
		}

		// test for proper write-argument -> see FIGURE 7-5 and TABLE 4-1
		testForWriteAndRead((byte) 0b1011100);

		// test success

		reset(i2cDevice);

		final int[] length = new int[1];

		// 0b1111111110101 -> Status-bits (see 4.2.2.1)
		mockReadResult(i2cDevice, (byte) 0b00011111, (byte) 0b11110101, length);

        DeviceControllerDeviceStatus deviceStatus1 = controller.getDeviceStatus();

		// test for proper write-argument -> see FIGURE 7-5 and TABLE 4-1
		testForWriteAndRead((byte) 0b1011100);

		assertTrue("On calling 'getDeviceStatus' the method I2CDevice.read(...)"
				+ "is called with a byte-array as first argument. The length of this "
				+ "array must be at least 2 but was " + length[0], length[0] >= 2);

		assertEquals("Unexpected EEPROM-write-active-flag according to "
				+ "status-bits 0b1111111110101 (see 4.2.2.1)",
				false, deviceStatus1.isEepromWriteActive());
		assertEquals("Unexpected channel-B-locked-flag according to "
				+ "status-bits 0b1111111110101 (see 4.2.2.1)",
				true, deviceStatus1.isChannelBLocked());
		assertEquals("Unexpected channel-A-locked-flag according to "
				+ "status-bits 0b1111111110101 (see 4.2.2.1)",
				false, deviceStatus1.isChannelALocked());
		assertEquals("Unexpected EEPROM-write-protected-flag according to "
				+ "status-bits 0b1111111110101 (see 4.2.2.1)",
				true, deviceStatus1.isEepromWriteProtected());

		reset(i2cDevice);

		// 0b1111111111010 -> Status-bits (see 4.2.2.1)
		mockReadResult(i2cDevice, (byte) 0b00011111, (byte) 0b11111010, length);

        DeviceControllerDeviceStatus deviceStatus2 = controller.getDeviceStatus();

		// test for proper write-argument -> see FIGURE 7-5 and TABLE 4-1
		testForWriteAndRead((byte) 0b1011100);

		assertTrue("On calling 'getDeviceStatus' the method I2CDevice.read(...)"
				+ "is called with a byte-array as first argument. The length of this "
				+ "array must be at least 2 but was " + length[0], length[0] >= 2);

		assertEquals("Unexpected EEPROM-write-active-flag according to "
				+ "status-bits 0b1111111111010 (see 4.2.2.1)",
				true, deviceStatus2.isEepromWriteActive());
		assertEquals("Unexpected channel-B-locked-flag according to "
				+ "status-bits 0b1111111111010 (see 4.2.2.1)",
				false, deviceStatus2.isChannelBLocked());
		assertEquals("Unexpected channel-A-locked-flag according to "
				+ "status-bits 0b1111111111010 (see 4.2.2.1)",
				true, deviceStatus2.isChannelALocked());
		assertEquals("Unexpected EEPROM-write-protected-flag according to "
				+ "status-bits 0b1111111111010 (see 4.2.2.1)",
				false, deviceStatus2.isEepromWriteProtected());

		// test wrong answer from device

		reset(i2cDevice);

		// 0b0000000000000000 -> malformed result!
		mockReadResult(i2cDevice, (byte) 0b00000000, (byte) 0b000000000, length);

		try {

			controller.getDeviceStatus();

			fail("Excpected IOException (but there is no) because "
					+ "I2CDevice-mock returns malformed device-status!");

		} catch (IOException e) {
			// expected
		}

		// test for proper write-argument -> see FIGURE 7-5 and TABLE 4-1
		testForWriteAndRead((byte) 0b1011100);

		assertTrue("On calling 'getDeviceStatus' the method I2CDevice.read(...)"
				+ "is called with a byte-array as first argument. The length of this "
				+ "array must be at least 2 but was " + length[0], length[0] >= 2);

	}