builder:TemplatePropertiesTest: added
This commit is contained in:
parent
419817f25f
commit
a90751a237
1 changed files with 47 additions and 0 deletions
|
@ -0,0 +1,47 @@
|
||||||
|
package net.kemitix.checkstyle.ruleset.builder;
|
||||||
|
|
||||||
|
import org.assertj.core.api.SoftAssertions;
|
||||||
|
import org.junit.Before;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
import java.nio.file.Path;
|
||||||
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tests for {@link TemplateProperties}.
|
||||||
|
*
|
||||||
|
* @author Paul Campbell (pcampbell@kemitix.net)
|
||||||
|
*/
|
||||||
|
public class TemplatePropertiesTest {
|
||||||
|
|
||||||
|
private TemplateProperties templateProperties;
|
||||||
|
|
||||||
|
@Before
|
||||||
|
public void setUp() throws Exception {
|
||||||
|
templateProperties = new TemplateProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void setAndGet() throws Exception {
|
||||||
|
//given
|
||||||
|
final Path checkstyleXml = Paths.get("checkstyle.xml");
|
||||||
|
final Path readmeTemplate = Paths.get("readme.md");
|
||||||
|
final Path readmeFragments = Paths.get("readme.dir");
|
||||||
|
//when
|
||||||
|
templateProperties.setCheckstyleXml(checkstyleXml);
|
||||||
|
templateProperties.setReadmeTemplate(readmeTemplate);
|
||||||
|
templateProperties.setReadmeFragments(readmeFragments);
|
||||||
|
//then
|
||||||
|
SoftAssertions.assertSoftly(softly -> {
|
||||||
|
softly.assertThat(templateProperties.getCheckstyleXml())
|
||||||
|
.as("set/getCheckstyleXml()")
|
||||||
|
.isEqualTo(checkstyleXml);
|
||||||
|
softly.assertThat(templateProperties.getReadmeTemplate())
|
||||||
|
.as("set/getReadmeTemplate()")
|
||||||
|
.isEqualTo(readmeTemplate);
|
||||||
|
softly.assertThat(templateProperties.getReadmeFragments())
|
||||||
|
.as("set/getReadmeFragments()")
|
||||||
|
.isEqualTo(readmeFragments);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue