@Override public IChemObject newTestObject() { return new Isotope(new Element()); } });
@BeforeClass public static void setUp() { setTestObjectBuilder(new ITestObjectBuilder() { @Override public IChemObject newTestObject() { return new Isotope(new Element()); } }); }
@Test public void testIsotope_String() { IIsotope i = new Isotope("C"); Assert.assertEquals("C", i.getSymbol()); }
@Test public void testIsotope_String_int() { IIsotope i = new Isotope("C", 12); Assert.assertEquals(12, i.getMassNumber().intValue()); Assert.assertEquals("C", i.getSymbol()); }
@Test public void testIsotope_int_String_int_double_double() { IIsotope i = new Isotope(6, "C", 12, 12.001, 80.0); Assert.assertEquals(12, i.getMassNumber().intValue()); Assert.assertEquals("C", i.getSymbol()); Assert.assertEquals(6, i.getAtomicNumber().intValue()); Assert.assertEquals(12.001, i.getExactMass(), 0.001); Assert.assertEquals(80.0, i.getNaturalAbundance(), 0.001); }
@Test public void testIsotope_IElement() { IElement element = newChemObject().getBuilder().newInstance(IElement.class, "C"); IIsotope i = new Isotope(element); Assert.assertEquals("C", i.getSymbol()); }
@Test public void testIsotope_int_String_double_double() { IIsotope i = new Isotope(6, "C", 12.001, 80.0); Assert.assertEquals("C", i.getSymbol()); Assert.assertEquals(6, i.getAtomicNumber().intValue()); Assert.assertEquals(12.001, i.getExactMass(), 0.001); Assert.assertEquals(80.0, i.getNaturalAbundance(), 0.001); }