1. Project Clover database Tue Dec 20 2016 21:24:09 CET
  2. Package com.xpn.xwiki.doc

File AttachmentDiffTest.java

 

Code metrics

0
8
4
1
61
30
4
0.5
2
4
1

Classes

Class Line # Actions
AttachmentDiffTest 32 8 0% 4 0
1.0100%
 

Contributing tests

This file is covered by 4 tests. .

Source view

1    /*
2    * See the NOTICE file distributed with this work for additional
3    * information regarding copyright ownership.
4    *
5    * This is free software; you can redistribute it and/or modify it
6    * under the terms of the GNU Lesser General Public License as
7    * published by the Free Software Foundation; either version 2.1 of
8    * the License, or (at your option) any later version.
9    *
10    * This software is distributed in the hope that it will be useful,
11    * but WITHOUT ANY WARRANTY; without even the implied warranty of
12    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13    * Lesser General Public License for more details.
14    *
15    * You should have received a copy of the GNU Lesser General Public
16    * License along with this software; if not, write to the Free
17    * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
18    * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
19    */
20    package com.xpn.xwiki.doc;
21   
22    import org.junit.Test;
23   
24    import org.junit.Assert;
25   
26    /**
27    * Unit test for {@link AttachmentDiff}.
28    *
29    * @version $Id: 649805c09f11f0b70ff610c392c58e37c542540a $
30    * @since 5.0M2
31    */
 
32    public class AttachmentDiffTest
33    {
 
34  1 toggle @Test
35    public void toStringWhenVersionsNotNull()
36    {
37  1 AttachmentDiff diff = new AttachmentDiff("filename", "1.1", "1.2");
38  1 Assert.assertEquals("filename: 1.1 \u21E8 1.2", diff.toString());
39    }
40   
 
41  1 toggle @Test
42    public void toStringWhenNoOriginalVersion()
43    {
44  1 AttachmentDiff diff = new AttachmentDiff("filename", null, "1.1");
45  1 Assert.assertEquals("filename: () \u21E8 1.1", diff.toString());
46    }
47   
 
48  1 toggle @Test
49    public void toStringWhenNoNewVersion()
50    {
51  1 AttachmentDiff diff = new AttachmentDiff("filename", "1.1", null);
52  1 Assert.assertEquals("filename: 1.1 \u21E8 ()", diff.toString());
53    }
54   
 
55  1 toggle @Test
56    public void toStringWhenNoVersions()
57    {
58  1 AttachmentDiff diff = new AttachmentDiff("filename", null, null);
59  1 Assert.assertEquals("filename: () \u21E8 ()", diff.toString());
60    }
61    }