chat/client/src/test/java/org/apidesign/html/chatserver/client/ChatClientTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sun, 12 Jan 2014 23:25:42 +0100
branchNbHtml4J
changeset 57 9984b9f7d8c6
parent 13 fd9a16bbfd0e
permissions -rw-r--r--
Adjusting to new naming scheme (which includes netbeans name)
jtulach@5
     1
/**
jtulach@5
     2
 * The MIT License (MIT)
jtulach@5
     3
 *
jtulach@5
     4
 * Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jtulach@5
     5
 *
jtulach@5
     6
 * Permission is hereby granted, free of charge, to any person obtaining a copy
jtulach@5
     7
 * of this software and associated documentation files (the "Software"), to deal
jtulach@5
     8
 * in the Software without restriction, including without limitation the rights
jtulach@5
     9
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
jtulach@5
    10
 * copies of the Software, and to permit persons to whom the Software is
jtulach@5
    11
 * furnished to do so, subject to the following conditions:
jtulach@5
    12
 *
jtulach@5
    13
 * The above copyright notice and this permission notice shall be included in
jtulach@5
    14
 * all copies or substantial portions of the Software.
jtulach@5
    15
 *
jtulach@5
    16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
jtulach@5
    17
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
jtulach@5
    18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
jtulach@5
    19
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
jtulach@5
    20
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
jtulach@5
    21
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
jtulach@5
    22
 * THE SOFTWARE.
jtulach@5
    23
 */
jtulach@13
    24
package org.apidesign.html.chatserver.client;
jtulach@5
    25
jtulach@5
    26
import static org.testng.Assert.*;
jtulach@5
    27
import org.testng.annotations.Test;
jtulach@5
    28
jtulach@5
    29
/**
jtulach@5
    30
 *
jtulach@5
    31
 * @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
jtulach@5
    32
 */
jtulach@5
    33
public class ChatClientTest {
jtulach@5
    34
    public ChatClientTest() {
jtulach@5
    35
    }
jtulach@5
    36
    
jtulach@5
    37
    @Test public void hasSendEnabled() {
jtulach@57
    38
        ChatModel m = new ChatModel();
jtulach@5
    39
        assertFalse(m.isSendEnabled(), "By default disabled");
jtulach@11
    40
        m.setComment("some msg");
jtulach@5
    41
        m.setUser("by me");
jtulach@5
    42
        assertTrue(m.isSendEnabled(), "Now it is enabled");
jtulach@5
    43
        m.setUser(null);
jtulach@5
    44
        assertFalse(m.isSendEnabled(), "No user means disabled");
jtulach@5
    45
        m.setUser("by him");
jtulach@5
    46
        assertTrue(m.isSendEnabled(), "Again enabled");
jtulach@11
    47
        m.setComment("");
jtulach@5
    48
        assertFalse(m.isSendEnabled(), "Empty text means disabled");
jtulach@5
    49
    }
jtulach@5
    50
}