package org.ourfilesystem.test.db;

/*
OurFileSystem is a peer2peer file sharing program.
Copyright (C) 2012  Robert Gass

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

*/

import static org.junit.Assert.*;

import java.util.HashSet;

import org.junit.Test;
import org.ourfilesystem.db.Peer;

public class EqualsTest {
	
	@Test
	public void testIT() {
		Peer p0 = StorageImplTest.getPeer(99L);
		Peer p1 = StorageImplTest.getPeer(99L);
		
		assertTrue(p0.equals(p1));
		
		HashSet<Peer> hs = new HashSet<Peer>();
		hs.add(p0);
		assertEquals(hs.size(), 1);
		hs.add(p1);
		assertEquals(hs.size(), 1);
	}

}
