Examples of calculateRate()


Examples of com.dodo.blog.model.Article.calculateRate()

    @Test
    public void testRateLogic()
    {
        Article article = new Article();
        org.junit.Assert.assertEquals( Double.valueOf( 0 ), article.calculateRate() );

        article.incrementRate( 3L );
        org.junit.Assert.assertEquals( Double.valueOf( 3 ), article.calculateRate() );

        article.incrementRate( 5L );
View Full Code Here

Examples of com.dodo.blog.model.Article.calculateRate()

    {
        Article article = new Article();
        org.junit.Assert.assertEquals( Double.valueOf( 0 ), article.calculateRate() );

        article.incrementRate( 3L );
        org.junit.Assert.assertEquals( Double.valueOf( 3 ), article.calculateRate() );

        article.incrementRate( 5L );
        org.junit.Assert.assertEquals( Double.valueOf( 4 ), article.calculateRate() );

        article.incrementRate( 1L );
View Full Code Here

Examples of com.dodo.blog.model.Article.calculateRate()

        article.incrementRate( 3L );
        org.junit.Assert.assertEquals( Double.valueOf( 3 ), article.calculateRate() );

        article.incrementRate( 5L );
        org.junit.Assert.assertEquals( Double.valueOf( 4 ), article.calculateRate() );

        article.incrementRate( 1L );
        org.junit.Assert.assertEquals( Double.valueOf( 3 ), article.calculateRate() );
    }
View Full Code Here

Examples of com.dodo.blog.model.Article.calculateRate()

        article.incrementRate( 5L );
        org.junit.Assert.assertEquals( Double.valueOf( 4 ), article.calculateRate() );

        article.incrementRate( 1L );
        org.junit.Assert.assertEquals( Double.valueOf( 3 ), article.calculateRate() );
    }

    @Test
    public void testRate() throws Exception
    {
View Full Code Here

Examples of com.dodo.blog.model.Article.calculateRate()

        accountService.saveAccount( account );

        // rate article
        Article article = saveArticle();
        article = articleService.rate( article.getId(), account.getId(), 5L );
        Assert.assertEquals( ( double ) 5, article.calculateRate() );

        // rate again to test exception
        try
        {
            articleService.rate( article.getId(), account.getId(), 3L );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.