Implement help command, add more tests, improve messages
[cacert-votebot.git] / src / test / java / org / cacert / votebot / shared / exceptions / InvalidNickNameTest.java
1 /*
2 * Copyright (c) 2016, 2018 Jan Dittberner
3 *
4 * This file is part of CAcert VoteBot.
5 *
6 * CAcert VoteBot is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3 of the License, or (at your option)
9 * any later version.
10 *
11 * CAcert VoteBot is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along with
17 * CAcert VoteBot. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 package org.cacert.votebot.shared.exceptions;
21
22 import org.junit.Test;
23
24 import java.text.MessageFormat;
25 import java.util.ResourceBundle;
26
27 import static org.junit.Assert.assertEquals;
28
29 /**
30 * @author Jan Dittberner
31 */
32 public class InvalidNickNameTest {
33 @Test
34 public void testConstructor() {
35 final InvalidNickName e = new InvalidNickName("test");
36 assertEquals(
37 e.getMessage(),
38 MessageFormat.format(
39 ResourceBundle.getBundle("messages").getString("invalid_nick_name"),
40 "test"));
41 }
42 }