1 /* 2 * Copyright (C) 2009 Mark Rijnbeek <mark_rynbeek@users.sf.net> 3 * 4 * Contact: cdk-devel@lists.sourceforge.net 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Lesser General Public License 8 * as published by the Free Software Foundation; either version 2.1 9 * of the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU Lesser General Public License for more details. 15 * 16 * You should have received a copy of the GNU Lesser General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 19 * 20 */ 21 package org.openscience.cdk.renderer.color; 22 23 import java.awt.Color; 24 25 import org.junit.Assert; 26 import org.junit.Test; 27 28 import org.openscience.cdk.Atom; 29 import org.openscience.cdk.CDKTestCase; 30 import org.openscience.cdk.PseudoAtom; 31 import org.openscience.cdk.interfaces.IAtom; 32 33 /** 34 * @cdk.module test-render 35 */ 36 public class RasmolColorsTest extends CDKTestCase { 37 38 @Test testGetAtomColor()39 public void testGetAtomColor() { 40 RasmolColors colors = new RasmolColors(); 41 42 Assert.assertNotNull(colors); 43 IAtom sulfur = new Atom("S"); 44 Assert.assertEquals(new Color(255, 200, 50), colors.getAtomColor(sulfur)); 45 46 IAtom helium = new Atom("He"); 47 Assert.assertEquals(new Color(255, 192, 203), colors.getAtomColor(helium)); 48 } 49 50 @Test testGetDefaultAtomColor()51 public void testGetDefaultAtomColor() { 52 RasmolColors colors = new RasmolColors(); 53 54 Assert.assertNotNull(colors); 55 IAtom imaginary = new PseudoAtom("Ix"); 56 Assert.assertEquals(Color.ORANGE, colors.getAtomColor(imaginary, Color.ORANGE)); 57 } 58 59 } 60