Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
unit test for toString() method as required in issue #33
- Loading branch information
Luigi R. Viggiano
committed
Jun 16, 2013
1 parent
072df15
commit 03055f7
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (c) 2013, Luigi R. Viggiano | ||
* All rights reserved. | ||
* | ||
* This software is distributable under the BSD license. | ||
* See the terms of the BSD license in the documentation provided with this software. | ||
*/ | ||
|
||
package org.aeonbits.owner; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
|
||
/** | ||
* @author Luigi R. Viggiano | ||
*/ | ||
public class ToStringTest { | ||
|
||
interface MyConfig extends Config { | ||
@Key("max.threads") | ||
@DefaultValue("25") | ||
int maxThreads(); | ||
|
||
@Key("max.folders") | ||
@DefaultValue("99") | ||
int maxFolders(); | ||
|
||
@Key("default.name") | ||
@DefaultValue("untitled") | ||
String defaultName(); | ||
} | ||
|
||
@Test | ||
public void toStringTest() { | ||
MyConfig cfg = ConfigFactory.create(MyConfig.class); | ||
assertEquals("{default.name=untitled, max.folders=99, max.threads=25}", cfg.toString()); | ||
} | ||
} |