Package dbfit.util

Source Code of dbfit.util.ParseHelperTest

package dbfit.util;

import fit.Fixture;

import org.junit.Test;
import org.junit.Before;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertEquals;

public class ParseHelperTest {
    private ParseHelper parseHelper;

    @Before
    public void prepare() {
        SymbolUtil.setSymbol("NULL_SYMBOL", null);
        SymbolUtil.setSymbol("SYMBOL_X", "X");
        parseHelper = new ParseHelper(new Fixture(), String.class);
    }

    @Test
    public void canParseNonNullSymbols() throws Exception {
        assertEquals("X", parseHelper.parse("<<SYMBOL_X"));
    }

    @Test
    public void canParseNullSymbols() throws Exception {
        assertNull(parseHelper.parse("<<NULL_SYMBOL"));
    }

    @Test
    public void undefinedSymbolDefaultsToNull() throws Exception {
        assertNull(parseHelper.parse("<<MISSING_SYMBOL"));
    }
}
TOP

Related Classes of dbfit.util.ParseHelperTest

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.