/*
* Copyright 2013 Objectos, Fábrica de Software LTDA.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package br.com.objectos.way.ui.builder;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasToString;
import org.testng.annotations.Test;
import br.com.objectos.way.ui.builder.Html;
import br.com.objectos.way.ui.builder.HtmlA;
/**
* @author carolene.bertoldi@objectos.com.br (Carolene Bertoldi)
*/
@Test
public class HtmlAnchorTest {
public void a() {
HtmlA ui = Html.a()
.end();
assertThat(ui, hasToString(equalTo("<a></a>")));
}
public void a_com_id() {
HtmlA ui = Html.a()
.id("id")
.end();
assertThat(ui, hasToString(equalTo("<a id=\"id\"></a>")));
}
public void a_com_name() {
HtmlA ui = Html.a()
.name("name")
.end();
assertThat(ui, hasToString(equalTo("<a name=\"name\"></a>")));
}
public void a_style() {
HtmlA ui = Html.a()
.styleClass("span9")
.end();
assertThat(ui, hasToString(equalTo("<a class=\"span9\"></a>")));
}
public void a_com_href() {
HtmlA ui = Html.a()
.href("#href")
.end();
assertThat(ui, hasToString(equalTo("<a href=\"#href\"></a>")));
}
public void a_text() {
HtmlA ui = Html.a()
.text("Clique aqui")
.end();
assertThat(ui, hasToString(equalTo("<a>Clique aqui</a>")));
}
}