@Test public void testDifference() { IIsotope element1 = mock(IIsotope.class); IIsotope element2 = mock(IIsotope.class); when(element1.getSymbol()).thenReturn("H"); when(element2.getSymbol()).thenReturn("C"); IDifference difference = IsotopeDiff.difference(element1, element2); Assert.assertNotNull(difference); }
@Test public void testDiff() { IIsotope element1 = mock(IIsotope.class); IIsotope element2 = mock(IIsotope.class); when(element1.getSymbol()).thenReturn("H"); when(element2.getSymbol()).thenReturn("C"); String result = IsotopeDiff.diff(element1, element2); Assert.assertNotNull(result); Assert.assertNotSame(0, result.length()); assertContains(result, "IsotopeDiff"); assertContains(result, "H/C"); }
@Test public void testMatchAgainstItself() { IIsotope element1 = mock(IIsotope.class); String result = IsotopeDiff.diff(element1, element1); assertZeroLength(result); }