1 | package de.uka.ipd.sdq.probfunction.math.test; |
2 | |
3 | import junit.framework.Assert; |
4 | |
5 | import org.junit.Test; |
6 | |
7 | import de.uka.ipd.sdq.probfunction.math.IProbabilityFunctionFactory; |
8 | import de.uka.ipd.sdq.probfunction.math.ISample; |
9 | |
10 | |
11 | public class SampleTest{ |
12 | |
13 | public static IProbabilityFunctionFactory pfFactory = IProbabilityFunctionFactory.eINSTANCE; |
14 | |
15 | @Test |
16 | public void equals(){ |
17 | ISample s1a = pfFactory.createSample("Haus", 0.3); |
18 | ISample s1b = pfFactory.createSample("Haus", 0.3); |
19 | ISample s2 = pfFactory.createSample("Haus", 0.4); |
20 | ISample s3 = pfFactory.createSample(0.5 , 0.4); |
21 | |
22 | Assert.assertTrue(s1a.equals(s1a)); |
23 | Assert.assertTrue(s1a.equals(s1b)); |
24 | Assert.assertFalse(s1a.equals(s2)); |
25 | Assert.assertFalse(s1a.equals(s3)); |
26 | Assert.assertFalse(s1a.equals("Haus")); |
27 | } |
28 | |
29 | } |