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);
}
}