jtulach@13
|
1 |
/**
|
jtulach@13
|
2 |
* The MIT License (MIT)
|
jtulach@13
|
3 |
*
|
jtulach@13
|
4 |
* Copyright (C) 2013 Jaroslav Tulach <jaroslav.tulach@apidesign.org>
|
jtulach@13
|
5 |
*
|
jtulach@13
|
6 |
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
jtulach@13
|
7 |
* of this software and associated documentation files (the "Software"), to deal
|
jtulach@13
|
8 |
* in the Software without restriction, including without limitation the rights
|
jtulach@13
|
9 |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
jtulach@13
|
10 |
* copies of the Software, and to permit persons to whom the Software is
|
jtulach@13
|
11 |
* furnished to do so, subject to the following conditions:
|
jtulach@13
|
12 |
*
|
jtulach@13
|
13 |
* The above copyright notice and this permission notice shall be included in
|
jtulach@13
|
14 |
* all copies or substantial portions of the Software.
|
jtulach@13
|
15 |
*
|
jtulach@13
|
16 |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
jtulach@13
|
17 |
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
jtulach@13
|
18 |
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
jtulach@13
|
19 |
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
jtulach@13
|
20 |
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
jtulach@13
|
21 |
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
jtulach@13
|
22 |
* THE SOFTWARE.
|
jtulach@13
|
23 |
*/
|
jtulach@13
|
24 |
package org.apidesign.html.chatserver.model;
|
jtulach@13
|
25 |
|
jtulach@13
|
26 |
import static org.testng.Assert.*;
|
jtulach@13
|
27 |
import org.testng.annotations.Test;
|
jtulach@13
|
28 |
|
jtulach@13
|
29 |
/**
|
jtulach@13
|
30 |
*
|
jtulach@13
|
31 |
* @author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
|
jtulach@13
|
32 |
*/
|
jtulach@13
|
33 |
public class MessageImplTest {
|
jtulach@13
|
34 |
|
jtulach@13
|
35 |
@Test public void properlyConvertedToSeconds() {
|
jtulach@57
|
36 |
Message msg = new Message();
|
jtulach@13
|
37 |
msg.setSince(5143);
|
jtulach@13
|
38 |
assertEquals(msg.getAt(), "5s");
|
jtulach@13
|
39 |
}
|
jtulach@13
|
40 |
@Test public void properlyConvertedToMinutes() {
|
jtulach@57
|
41 |
Message msg = new Message();
|
jtulach@13
|
42 |
msg.setSince(63564);
|
jtulach@13
|
43 |
assertEquals(msg.getAt(), "1min");
|
jtulach@13
|
44 |
}
|
jtulach@13
|
45 |
} |