Skip to content
Permalink
Browse files

CbusTableEvent tests

  • Loading branch information...
icklesteve committed May 5, 2019
1 parent 54f1993 commit fe897fa9f7e3de98b991ce53d8704a1a943d9745
@@ -171,7 +171,7 @@ protected int getTotalOut(){
}

/**
* Set Total In Events
* Set Total On Events
*/
protected void setTotalOn(int newVal) {
_toton = newVal;
@@ -47,6 +47,12 @@ public void testSetGet() {
Assert.assertEquals("getSessionIn starts 0", 0,(t.getSessionIn()) );
Assert.assertEquals("getSessionOut starts 0", 0,(t.getSessionOut()) );

Assert.assertEquals("getTotalOn starts 0", 0,(t.getTotalOn()) );
Assert.assertEquals("getTotalOff starts 0", 0,(t.getTotalOff()) );
Assert.assertEquals("getTotalIn starts 0", 0,(t.getTotalIn()) );
Assert.assertEquals("getTotalOut starts 0", 0,(t.getTotalOut()) );


t.bumpSessionOn();
t.bumpSessionOff();
t.bumpSessionIn();
@@ -57,6 +63,30 @@ public void testSetGet() {
Assert.assertEquals("getSessionIn 1", 1,(t.getSessionIn()) );
Assert.assertEquals("getSessionOut 1", 1,(t.getSessionOut()) );

Assert.assertEquals("getTotalOn 1", 1,(t.getTotalOn()) );
Assert.assertEquals("getTotalOff 1", 1,(t.getTotalOff()) );
Assert.assertEquals("getTotalIn 1", 1,(t.getTotalIn()) );
Assert.assertEquals("getTotalOut 1", 1,(t.getTotalOut()) );


t.resetSessionTotals();

Assert.assertEquals("getSessionOn reset", 0,(t.getSessionOn()) );
Assert.assertEquals("getSessionOff reset", 0,(t.getSessionOff()) );
Assert.assertEquals("getSessionIn reset", 0,(t.getSessionIn()) );
Assert.assertEquals("getSessionOut reset", 0,(t.getSessionOut()) );

t.setTotalOn(123);
t.setTotalOff(456);
t.setTotalIn(789);
t.setTotalOut(0);

Assert.assertEquals("getTotalOn 123", 123,(t.getTotalOn()) );
Assert.assertEquals("getTotalOff 456", 456,(t.getTotalOff()) );
Assert.assertEquals("getTotalIn 789", 789,(t.getTotalIn()) );
Assert.assertEquals("getTotalOut 0", 0,(t.getTotalOut()) );


}


0 comments on commit fe897fa

Please sign in to comment.
You can’t perform that action at this time.