Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package de.agilecoders.wicket.core.util;
 
 import org.junit.Test;
 
 import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;

Tests the Models class

Author(s):
miha
public class ModelsTest {
    @Test
    public void isNullOrEmptyReturnsTrueForEmptyModel() {
        assertThat(Models.isNullOrEmpty(Model.of("")), is(equalTo(true)));
    }
    @Test
        assertThat(Models.isNullOrEmpty(Model.of((String)null)), is(equalTo(true)));
    }
    @Test
    public void isNullOrEmptyReturnsTrueForNullModel() {
        assertThat(Models.isNullOrEmpty(null), is(equalTo(true)));
    }
    @Test
        assertThat(Models.isNullOrEmpty(Model.of("value")), is(equalTo(false)));
    }
New to GrepCode? Check out our FAQ X