|
Java example source code file (RoundCountTest.java)
The RoundCountTest.java Java example source codepackage org.deeplearning4j.models.glove.count; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.*; /** * Created by fartovii on 23.12.15. */ public class RoundCountTest { @Before public void setUp() throws Exception { } @Test public void testGet1() throws Exception { RoundCount count = new RoundCount(1); assertEquals(0, count.get()); count.tick(); assertEquals(1, count.get()); count.tick(); assertEquals(0, count.get()); } @Test public void testGet2() throws Exception { RoundCount count = new RoundCount(3); assertEquals(0, count.get()); count.tick(); assertEquals(1, count.get()); count.tick(); assertEquals(2, count.get()); count.tick(); assertEquals(3, count.get()); count.tick(); assertEquals(0, count.get()); } @Test public void testPrevious1() throws Exception { RoundCount count = new RoundCount(3); assertEquals(0, count.get()); assertEquals(3, count.previous()); count.tick(); assertEquals(1, count.get()); assertEquals(0, count.previous()); count.tick(); assertEquals(2, count.get()); assertEquals(1, count.previous()); count.tick(); assertEquals(3, count.get()); assertEquals(2, count.previous()); count.tick(); assertEquals(0, count.get()); assertEquals(3, count.previous()); } } Other Java examples (source code examples)Here is a short list of links related to this Java RoundCountTest.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.