示例#1
0
  public void testItShouldChangeItsSymbolWhenGivenAValidNewOne() {
    Molecule molecule = new DefaultMolecule();
    Atom atom = molecule.addAtom("C");

    atom.setSymbol("O");

    assertEquals("O", atom.getSymbol());
  }
示例#2
0
  public void testItShouldThrowWhenSettingAnIllegalAtomLabel() {
    Molecule molecule = new DefaultMolecule();
    Atom atom = molecule.addAtom("C");

    try {
      atom.setSymbol("bailout");
      fail();
    } catch (IllegalStateException e) {
    }
  }