samples/individualsamples/test/org/apidesign/samples/CodeThatCanBeCalledOnlyByTestTest.java
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:57:12 +0200
changeset 143 20dad4daf81b
permissions -rw-r--r--
Special project for inidividual samples, used to show code that can be called only from test
jtulach@143
     1
package org.apidesign.samples;
jtulach@143
     2
jtulach@143
     3
import org.junit.Test;
jtulach@143
     4
import static org.junit.Assert.*;
jtulach@143
     5
jtulach@143
     6
public class CodeThatCanBeCalledOnlyByTestTest {
jtulach@143
     7
jtulach@143
     8
    public CodeThatCanBeCalledOnlyByTestTest() {
jtulach@143
     9
    }
jtulach@143
    10
jtulach@143
    11
    @Test
jtulach@143
    12
    public void setNumber() {
jtulach@143
    13
        CodeThatCanBeCalledOnlyByTest.setNumber(111);
jtulach@143
    14
        assertEquals(
jtulach@143
    15
            "Changing number is OK from tests", 
jtulach@143
    16
            111, 
jtulach@143
    17
            CodeThatCanBeCalledOnlyByTest.getNumber()
jtulach@143
    18
        );
jtulach@143
    19
    }
jtulach@143
    20
jtulach@143
    21
}