/*
 * Copyright 2017 Riyaz Ahamed
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.ahamed.multiviewadapter;

import android.support.test.runner.AndroidJUnit4;
import org.junit.Test;
import org.junit.runner.RunWith;

import static junit.framework.Assert.assertEquals;

@RunWith(AndroidJUnit4.class) public class RecyclerAdapterITest {

  private RecyclerAdapter recyclerAdapter = new RecyclerAdapter();

  @Test public void setExpandableModeTest() {
    recyclerAdapter.setExpandableMode(RecyclerAdapter.EXPANDABLE_MODE_MULTIPLE);
    assertEquals(recyclerAdapter.expandableMode, RecyclerAdapter.EXPANDABLE_MODE_MULTIPLE);
  }

  @Test public void setGroupExpandableModeTest() {
    recyclerAdapter.setGroupExpandableMode(RecyclerAdapter.EXPANDABLE_MODE_MULTIPLE);
    assertEquals(recyclerAdapter.groupExpandableMode, RecyclerAdapter.EXPANDABLE_MODE_MULTIPLE);
  }
}

@@ -688,55 +688,324 @@
 ort 
-org.junit.Test;%0Aimport org.junit.runner.RunWith
+com.ahamed.multiviewadapter.listener.ItemSelectionChangedListener;%0Aimport com.ahamed.multiviewadapter.listener.MultiSelectionChangedListener;%0Aimport com.ahamed.multiviewadapter.testconfig.DummyOne;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.MockitoAnnotations
 ;%0A%0Ai
@@ -1053,16 +1053,58 @@
 tEquals;
+%0Aimport static org.mockito.Mockito.verify;
 %0A%0A@RunWi
@@ -1230,16 +1230,246 @@
 apter();
+%0A  private SelectableAdapter selectableAdapter = new SelectableAdapter();%0A%0A  @Mock ItemSelectionChangedListener%3CDummyOne%3E itemSelectionChangedListener;%0A  @Mock MultiSelectionChangedListener%3CDummyOne%3E multiSelectionChangedListener;
 %0A%0A  @Tes
@@ -1923,11 +1923,1027 @@
 LE);%0A  %7D
+%0A%0A  @Test public void onItemSelectionToggledTest() %7B%0A    MockitoAnnotations.initMocks(this);%0A%0A    selectableAdapter.setSelectionMode(SelectableAdapter.SELECTION_MODE_MULTIPLE);%0A%0A    DataListManager%3CDummyOne%3E dataListManager = new DataListManager%3C%3E(selectableAdapter);%0A    selectableAdapter.addDataManager(dataListManager);%0A%0A    for (int i = 0; i %3C 10; i++) %7B%0A      dataListManager.add(new DummyOne(i, %22DummyOne %22 + i));%0A    %7D%0A    dataListManager.setMultiSelectionChangedListener(multiSelectionChangedListener);%0A%0A    selectableAdapter.onItemSelectionToggled(1);%0A%0A    verify(multiSelectionChangedListener).onMultiSelectionChangedListener(%0A        dataListManager.getSelectedItems());%0A%0A    selectableAdapter.setSelectionMode(SelectableAdapter.SELECTION_MODE_SINGLE);%0A    dataListManager.setItemSelectionChangedListener(itemSelectionChangedListener);%0A%0A    selectableAdapter.onItemSelectionToggled(2);%0A%0A    verify(itemSelectionChangedListener).onItemSelectionChangedListener(dataListManager.getItem(2),%0A        true);%0A  %7D
 %0A%7D%0A

Add test case for onItemSelectionToggled method