package com.github.huangzhiyi.shpmdir;

import static org.junit.Assert.*;

import org.junit.Test;

public class CitySetTestcase {

	@Test
	public void test_toBinStr(){
		assertEquals("11",CitySet.ofCityCodes("1").toBinStr());
		assertEquals("1101",CitySet.ofCityCodes("1","3").toBinStr());
		assertEquals("1000010101",CitySet.ofCityCodes("5","7","9").toBinStr());
	}
	
	@Test
	public void test_ofBinStr(){
		assertEquals("11",CitySet.ofBinStr("11").toBinStr());
		assertEquals("1101",CitySet.ofBinStr("1101").toBinStr());
		assertEquals("1000010101",CitySet.ofBinStr("1000010101").toBinStr());
	}
	
	@Test
	public void test_contains(){
		assertTrue(CitySet.ofCityCodes("1","3").contains("1","3"));
		assertFalse(CitySet.ofCityCodes("1","3").contains("1","5"));
	}
}

@@ -784,11 +784,206 @@
 );%0D%0A%09%7D%0D%0A
+%09%0D%0A%09@Test%0D%0A%09public void test_isEmpty()%7B%0D%0A%09%09assertTrue(CitySet.emptySet().isEmpty());%0D%0A%09%09assertTrue(CitySet.ofCityCodes(%221%22).isNotEmpty());%0D%0A%09%09assertTrue(CitySet.ofCityCodes(%220%22).isEmpty());%0D%0A%09%7D%0D%0A
 %7D%0D%0A

Add testcase for CitySet.isEmpty()