Changeset 346


Ignore:
Timestamp:
12/22/11 10:28:52 (12 years ago)
Author:
sherbold
Message:
  • added JUnit test cases for public inner helper classes of de.ugoe.cs.eventbench.models.FirstOrderMarkovModel? and Trie
Location:
trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/FirstOrderMarkovModelTest.java

    r344 r346  
    88 
    99import de.ugoe.cs.eventbench.data.Event; 
     10import de.ugoe.cs.eventbench.models.FirstOrderMarkovModel.MarkovEdge; 
    1011import static org.junit.Assert.*; 
    1112 
     
    4849        } 
    4950         
     51        @Test 
     52        public void testMarkovEdgeMarkovEdge_1() throws Exception { 
     53                double weight = 0.2d; 
     54                 
     55                MarkovEdge result = new MarkovEdge(weight); 
     56                 
     57                assertNotNull(result); 
     58                assertEquals(weight, result.weight, 0.0001); 
     59        } 
     60         
     61        @Test 
     62        public void testMarkovEdgeToString_1() throws Exception { 
     63                double weight = 0.2d; 
     64                MarkovEdge fixture = new MarkovEdge(weight); 
     65                 
     66                String result = fixture.toString(); 
     67                 
     68                assertEquals(Double.toString(0.2d), result); 
     69        } 
     70         
    5071        @Before 
    5172        public void setUp() throws Exception { 
  • trunk/EventBenchCoreTest/src/de/ugoe/cs/eventbench/models/TrieTest.java

    r315 r346  
    99 
    1010import org.junit.*; 
     11 
     12import de.ugoe.cs.eventbench.models.Trie.Edge; 
     13import de.ugoe.cs.eventbench.models.Trie.TrieVertex; 
    1114import static org.junit.Assert.*; 
    1215 
     
    606609                assertTrue(root_b.isLeaf()); 
    607610        } 
     611         
     612        @Test 
     613        public void testEdgeEdge_1() throws Exception { 
     614                Edge result = new Edge(); 
     615                 
     616                assertNotNull(result); 
     617        } 
     618         
     619        @Test 
     620        public void testTrieVertexTrieVertex_1() throws Exception { 
     621                String id = "idString"; 
     622                 
     623                TrieVertex result = new TrieVertex(id); 
     624                 
     625                assertNotNull(result); 
     626        } 
     627         
     628        @Test 
     629        public void testTrieVertexToString_1() throws Exception { 
     630                String id = "idString"; 
     631                TrieVertex fixture = new TrieVertex(id); 
     632                 
     633                String result = fixture.toString(); 
     634                 
     635                assertEquals(id, result); 
     636        } 
    608637 
    609638        @Before 
Note: See TracChangeset for help on using the changeset viewer.