@@ -0,0 +1,2441 @@
+package com.uxxu.konashi.lib.action;%0A%0Aimport android.bluetooth.BluetoothGattCharacteristic;%0Aimport android.bluetooth.BluetoothGattService;%0A%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.mockito.ArgumentCaptor;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations;%0A%0Aimport java.util.UUID;%0A%0Aimport static org.assertj.core.api.Assertions.assertThat;%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * Created by izumin on 9/21/15.%0A */%0Apublic class I2cSendConditionActionTest %7B%0A%0A    @Mock private BluetoothGattService mService;%0A    @Mock private BluetoothGattCharacteristic mCharacteristic;%0A%0A    private I2cSendConditionAction mAction;%0A%0A    private ArgumentCaptor%3Cbyte%5B%5D%3E mValueCaptor;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        MockitoAnnotations.initMocks(this);%0A        mValueCaptor = ArgumentCaptor.forClass(byte%5B%5D.class);%0A        when(mService.getCharacteristic(any(UUID.class))).thenReturn(mCharacteristic);%0A    %7D%0A%0A    @Test%0A    public void hasValidParams_WithInvalidCondition() throws Exception %7B%0A        mAction = new I2cSendConditionAction(mService, 0x03);%0A        assertThat(mAction.hasValidParams()).isFalse();%0A    %7D%0A%0A    @Test%0A    public void hasValidParams_WithValidCondition() throws Exception %7B%0A        mAction = new I2cSendConditionAction(mService, 0x02);%0A        assertThat(mAction.hasValidParams()).isTrue();%0A    %7D%0A%0A    @Test%0A    public void setValue_StopCondition() throws Exception %7B%0A        mAction = new I2cSendConditionAction(mService, 0x00);%0A        mAction.setValue();%0A        verify(mCharacteristic, times(1)).setValue(mValueCaptor.capture());%0A        assertThat(mValueCaptor.getValue()%5B0%5D).isEqualTo((byte) 0x00);%0A    %7D%0A%0A    @Test%0A    public void setValue_StartCondition() throws Exception %7B%0A        mAction = new I2cSendConditionAction(mService, 0x01);%0A        mAction.setValue();%0A        verify(mCharacteristic, times(1)).setValue(mValueCaptor.capture());%0A        assertThat(mValueCaptor.getValue()%5B0%5D).isEqualTo((byte) 0x01);%0A    %7D%0A%0A    @Test%0A    public void setValue_RestartCondition() throws Exception %7B%0A        mAction = new I2cSendConditionAction(mService, 0x02);%0A        mAction.setValue();%0A        verify(mCharacteristic, times(1)).setValue(mValueCaptor.capture());%0A        assertThat(mValueCaptor.getValue()%5B0%5D).isEqualTo((byte) 0x02);%0A    %7D%0A%7D%0A

Add test for i2cSendConditionActionTest