/**
 * Copyright (c) 2016-2017 by the respective copyright holders.
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 */
package com.zsmartsystems.zwave.commandclass.impl.loopback;

import static org.junit.Assert.assertEquals;

import java.util.Map;
import com.zsmartsystems.zwave.commandclass.impl.CommandClassCentralSceneV1;

/**
 * Class to implement loopback tests for command class <b>COMMAND_CLASS_CENTRAL_SCENE</b> version <b>1</b>.
 * <p>
 * Note that this code is autogenerated. Manual changes may be overwritten.
 *
 * @author Chris Jackson - Initial contribution of Java code generator
 */
public class CommandClassCentralSceneV1LoopbackTest {
    /**
     * Performs an in/out test of the CENTRAL_SCENE_SUPPORTED_REPORT command.
     * <p>
     * Test is designed to ensure that the command generates the same data
     * as the handler processes and is mainly a check of the code generator.
     *
     * @param supportedScenes {@link Integer}
     */
    public static void testCentralSceneSupportedReportLoopback(Integer supportedScenes) {
        byte[] testPayload = CommandClassCentralSceneV1.getCentralSceneSupportedReport(supportedScenes);

        Map<String, Object> response = CommandClassCentralSceneV1.handleCentralSceneSupportedReport(testPayload);
        assertEquals(supportedScenes, (Integer) response.get("SUPPORTED_SCENES"));
    }

    /**
     * Performs an in/out test of the CENTRAL_SCENE_NOTIFICATION command.
     * <p>
     * Test is designed to ensure that the command generates the same data
     * as the handler processes and is mainly a check of the code generator.
     *
     * @param sequenceNumber {@link Integer}
     * @param keyAttributes {@link Integer}
     * @param sceneNumber {@link Integer}
     */
    public static void testCentralSceneNotificationLoopback(Integer sequenceNumber, Integer keyAttributes,
            Integer sceneNumber) {
        byte[] testPayload = CommandClassCentralSceneV1.getCentralSceneNotification(sequenceNumber, keyAttributes,
                sceneNumber);

        Map<String, Object> response = CommandClassCentralSceneV1.handleCentralSceneNotification(testPayload);
        assertEquals(sequenceNumber, (Integer) response.get("SEQUENCE_NUMBER"));
        assertEquals(keyAttributes, (Integer) response.get("KEY_ATTRIBUTES"));
        assertEquals(sceneNumber, (Integer) response.get("SCENE_NUMBER"));
    }

}
