Package ch.fusun.baron.player.test

Source Code of ch.fusun.baron.player.test.DynastyTest

package ch.fusun.baron.player.test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;

import org.junit.Test;

import ch.fusun.baron.player.Dynasty;

/**
* Tests dynasty domain object
*/
public class DynastyTest {

  /**
   * Tests if the equality function works
   */
  @Test
  public void testEquality() {
    Dynasty dynasty = new Dynasty("Test1", null); //$NON-NLS-1$
    Dynasty dynasty2 = new Dynasty("Test2", null); //$NON-NLS-1$
    Dynasty dynasty3 = new Dynasty("Test1", null); //$NON-NLS-1$

    assertEquals(dynasty, dynasty3);
    assertFalse(dynasty.equals(dynasty2));
    assertFalse(dynasty.equals(null));
    assertFalse(dynasty.equals(new String("Test1"))); //$NON-NLS-1$
  }
}
TOP

Related Classes of ch.fusun.baron.player.test.DynastyTest

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.