ko/kosample/client/src/test/java/org/apidesign/bck2brwsr/kosample/DataModelTest.java
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Tue, 26 Apr 2016 08:04:12 +0200
changeset 1941 621825e167d7
permissions -rw-r--r--
Adding sample module using knockout
jaroslav@1941
     1
/**
jaroslav@1941
     2
 * Back 2 Browser Bytecode Translator
jaroslav@1941
     3
 * Copyright (C) 2012-2015 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jaroslav@1941
     4
 *
jaroslav@1941
     5
 * This program is free software: you can redistribute it and/or modify
jaroslav@1941
     6
 * it under the terms of the GNU General Public License as published by
jaroslav@1941
     7
 * the Free Software Foundation, version 2 of the License.
jaroslav@1941
     8
 *
jaroslav@1941
     9
 * This program is distributed in the hope that it will be useful,
jaroslav@1941
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
jaroslav@1941
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
jaroslav@1941
    12
 * GNU General Public License for more details.
jaroslav@1941
    13
 *
jaroslav@1941
    14
 * You should have received a copy of the GNU General Public License
jaroslav@1941
    15
 * along with this program. Look for COPYING file in the top folder.
jaroslav@1941
    16
 * If not, see http://opensource.org/licenses/GPL-2.0.
jaroslav@1941
    17
 */
jaroslav@1941
    18
package org.apidesign.bck2brwsr.kosample;
jaroslav@1941
    19
jaroslav@1941
    20
import static org.testng.Assert.*;
jaroslav@1941
    21
import org.testng.annotations.Test;
jaroslav@1941
    22
jaroslav@1941
    23
public class DataModelTest {
jaroslav@1941
    24
    @Test public void testUIModelWithoutUI() {
jaroslav@1941
    25
        Data model = new Data();
jaroslav@1941
    26
        model.setMessage("Hello World!");
jaroslav@1941
    27
        
jaroslav@1941
    28
        java.util.List<String> arr = model.getWords();
jaroslav@1941
    29
        assertEquals(arr.size(), 6, "Six words always");
jaroslav@1941
    30
        assertEquals("Hello", arr.get(0), "Hello is the first word");
jaroslav@1941
    31
        assertEquals("World!", arr.get(1), "World is the second word");
jaroslav@1941
    32
    }
jaroslav@1941
    33
}