Package ch.fusun.baron.property.test

Source Code of ch.fusun.baron.property.test.PropertyServiceTest

package ch.fusun.baron.property.test;

import static org.junit.Assert.assertEquals;

import java.util.List;
import java.util.Map;

import org.junit.Test;

import ch.fusun.baron.property.PropertyServiceImpl;
import ch.fusun.baron.property.api.PropertyService;

/**
* Tests the {@link PropertyServiceImpl}
*/
public class PropertyServiceTest {
  /**
   * Tests that the correct entries are returned
   */
  @Test
  public void testGetAllOwnerships() {
    PropertyService service = new PropertyServiceImpl();
    String a = "a";
    String b = "b";
    Double c = 2.0;
    Integer i = 1;
    service.setOwnership(c, a);
    service.setOwnership(i, b);
    Map<Integer, List<String>> allOwnerships = service.getAllOwnerships(
        Integer.class, String.class);
    assertEquals("Wrong number of entries", 1, allOwnerships.size());
    assertEquals("Wrong entry", allOwnerships.get(i).get(0), b);
  }
}
TOP

Related Classes of ch.fusun.baron.property.test.PropertyServiceTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.