OSDN Git Service

1f2f6231695e8cb09613cb455859751c3a370fbb
[stigmata/stigmata-plugins.git] / wsp / src / test / java / jp / sourceforge / stigmata / birthmarks / wsp / WeightCalculatorTest.java
1 package jp.sourceforge.stigmata.birthmarks.wsp;
2
3 /*
4  * $Id$
5  */
6
7 import org.junit.Assert;
8 import org.junit.Before;
9 import org.junit.Test;
10
11 /**
12  * 
13  * @author Haruaki Tamada
14  * @version $Revision$
15  */
16 public class WeightCalculatorTest{
17     private WeightCalculator calculator;
18
19     @Before
20     public void setup(){
21         calculator = new WeightCalculator();
22     }
23
24     @Test
25     public void testCalculateWeightOfWcs(){
26         int[][] wcs = new int[][] {
27             {  6,  6,  9,  3, },
28             { 21, 18, 18,  6, },
29             {  9,  6, 12,  3, },
30             {  6,  9, 30,  9, },
31         };
32         Assert.assertEquals(60, calculator.calculateWeight(wcs));
33     }
34
35     @Test
36     public void testCalculateWeightOfWcs2(){
37         int[][] wcs = new int[][] {
38             { 16,  5,  0,  6, },
39             {  3,  0, 15,  6, },
40             {  2, 10,  0,  3, },
41             {  0,  2,  3,  9, },
42         };
43         Assert.assertEquals(50, calculator.calculateWeight(wcs));
44     }
45 }